Hysteresis compensation for detection of ECAPs

ABSTRACT

Systems, devices, and techniques are described for adjusting electrical stimulation based on detected ECAPs. In one example, a medical device includes processing circuitry configured to control stimulation circuitry to deliver a first electrical stimulation pulse and sensing circuitry to detect, after delivery of the first electrical stimulation pulse, an ECAP signal. The processing circuitry may be configured to determine a characteristic value of the ECAP signal, determine an ECAP differential value that indicates whether the characteristic value of the ECAP signal is one of greater than a selected ECAP characteristic value or less than the selected ECAP characteristic value, determine, based on the ECAP differential value, a gain value, determine, based on the gain value, a parameter value that at least partially defines a second electrical stimulation pulse, and control the stimulation circuitry to deliver the second electrical stimulation pulse according to the parameter value.

This application is a continuation of U.S. patent application Ser. No.16/721,491, filed Dec. 19, 2019, the entire contents of which isincorporated herein by reference.

TECHNICAL FIELD

This disclosure generally relates to electrical stimulation, and morespecifically, control of electrical stimulation.

BACKGROUND

Medical devices may be external or implanted and may be used to deliverelectrical stimulation therapy to patients via various tissue sites totreat a variety of symptoms or conditions such as chronic pain, tremor,Parkinson's disease, epilepsy, urinary or fecal incontinence, sexualdysfunction, obesity, or gastroparesis. A medical device may deliverelectrical stimulation therapy via one or more leads that includeelectrodes located proximate to target locations associated with thebrain, the spinal cord, pelvic nerves, peripheral nerves, or thegastrointestinal tract of a patient. Stimulation proximate the spinalcord, proximate the sacral nerve, within the brain, and proximateperipheral nerves are often referred to as spinal cord stimulation(SCS), sacral neuromodulation (SNM), deep brain stimulation (DBS), andperipheral nerve stimulation (PNS), respectively.

Electrical stimulation may be delivered to a patient by the medicaldevice in a train of electrical pulses, and parameters of the electricalpulses may include a frequency, an amplitude, a pulse width, and a pulseshape. An evoked compound action potential (ECAP) is synchronous firingof a population of neurons which occurs in response to the applicationof a stimulus including, in some cases, an electrical stimulus by amedical device. The ECAP may be detectable as being a separate eventfrom the stimulus itself, and the ECAP may reveal characteristics of theeffect of the stimulus on the nerve fibers.

SUMMARY

In general, systems, devices, and techniques are described for managingthe delivery of electrical stimulation based on evoked compound actionpotential (ECAP) signals sensed from a patient. When a patient moves,the distance between implanted electrodes and target nerves changes. Forexample, electrodes implanted along the spinal column are closer to thespinal cord when a subject lies in a supine posture state as compared toa standing posture state. Similarly, the implanted electrodes may movecloser to the spinal cord when a subject coughs or sneezes. Thischanging distance between the electrodes and target tissue affectsneural recruitment for a given intensity of delivered stimulation andcan cause the patient's perception and/or therapeutic benefit to alsochange. Therefore, a characteristic value of the ECAP signal canrepresent the change in distance, and a system can modulate electricalstimulation using the characteristic value as feedback.

In some examples, the system may adjust a stimulation parameter valuethat at least partially defines subsequent stimulation pulses based on aselected ECAP characteristic value, such as a target ECAP characteristicvalue of a threshold ECAP characteristic value. The stimulationparameter value may at least partially determine a stimulation intensityfor a stimulation pulse. For example, the system may increase ordecrease the stimulation parameter value for subsequent pulses inresponse to determining that the determined characteristic value of therecent ECAP signal is greater than or less than the target ECAPcharacteristic or a threshold ECAP characteristic.

However, the patient may have a sensitivity to increasing stimulationintensity that is different than the sensitivity to decreasingstimulation intensity. This sensitivity may be indicated by differentgrowth curves, which are representative of the relationship betweenstimulation parameter values and ECAP characteristic values. In oneexample, the patient may be more sensitive to increasing stimulationintensity than decreasing stimulation intensity. The system may thusincrease the stimulation parameter value using a gain value specific toincreasing the parameter value and decrease the stimulation parametervalue using a different gain value specific to decreasing the parametervalue. Using these different gain values, the system may more preciselyadjust stimulation intensity by reducing the probability ofoverstimulation and understimulation during parameter value adjustmentto achieve the target ECAP characteristic value and effectivestimulation therapy. In some examples, the patient may use differentsets of gain values for respective posture states of the patient.

In one example, a system includes stimulation circuitry, sensingcircuitry, and processing circuitry configured to control thestimulation circuitry to deliver a first electrical stimulation pulse,control the sensing circuitry to detect, after delivery of the firstelectrical stimulation pulse, an ECAP signal, determine a characteristicvalue of the ECAP signal elicited by the first electrical stimulationpulse, determine an ECAP differential value that indicates whether thecharacteristic value of the ECAP signal elicited by the first electricalstimulation pulse is one of greater than a selected ECAP characteristicvalue or less than the selected ECAP characteristic value, determine,based on the ECAP differential value, a gain value, determine, based onthe gain value, a parameter value that at least partially defines asecond electrical stimulation pulse, and control the stimulationcircuitry to deliver the second electrical stimulation pulse accordingto the parameter value.

In another example, a method includes controlling, by processingcircuitry, stimulation circuitry to deliver a first electricalstimulation pulse, controlling, by the processing circuitry, sensingcircuitry to detect, after delivery of the first electrical stimulationpulse, an ECAP signal, determining, by the processing circuitry, acharacteristic value of the ECAP signal elicited by the first electricalstimulation pulse, determining, by the processing circuitry, an ECAPdifferential value that indicates whether the characteristic value ofthe ECAP signal elicited by the first electrical stimulation pulse isone of greater than a selected ECAP characteristic value or less thanthe selected ECAP characteristic value, determining, by the processingcircuitry and based on the ECAP differential value, a gain value,determining, by the processing circuitry and based on the gain value, aparameter value that at least partially defines a second electricalstimulation pulse; and controlling, by the processing circuitry, thestimulation circuitry to deliver the second electrical stimulation pulseaccording to the parameter value.

In another example, a computer-readable storage medium comprisinginstructions that, when executed by processing circuitry, cause theprocessing circuitry to control the stimulation circuitry to deliver afirst electrical stimulation pulse, control the sensing circuitry todetect, after delivery of the first electrical stimulation pulse, anECAP signal, determine a characteristic value of the ECAP signalelicited by the first electrical stimulation pulse, determine an ECAPdifferential value that indicates whether the characteristic value ofthe ECAP signal elicited by the first electrical stimulation pulse isone of greater than a selected ECAP characteristic value or less thanthe selected ECAP characteristic value, determine, based on the ECAPdifferential value, a gain value, determine, based on the gain value, aparameter value that at least partially defines a second electricalstimulation pulse, and control the stimulation circuitry to deliver thesecond electrical stimulation pulse according to the parameter value.

The summary is intended to provide an overview of the subject matterdescribed in this disclosure. It is not intended to provide an exclusiveor exhaustive explanation of the systems, device, and methods describedin detail within the accompanying drawings and description below.Further details of one or more examples of this disclosure are set forthin the accompanying drawings and in the description below. Otherfeatures, objects, and advantages of the techniques will be apparentfrom the description and drawings, and from the claims.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a conceptual diagram illustrating an example system thatincludes a medical device programmer and an IMD according to thetechniques of the disclosure.

FIG. 2 is a block diagram of the example IMD of FIG. 1 .

FIG. 3 is a block diagram of the example external programmer of FIG. 1 .

FIG. 4 is a graph of an example ECAP signal sensed from a stimulationpulse.

FIG. 5 is a timing diagram illustrating one example of electricalstimulation pulses and respective sensed ECAPs, in accordance with oneor more techniques of this disclosure.

FIG. 6 is a graph of example growth curves derived from sensed ECAPsduring respective posture states.

FIG. 7 is a flow diagram illustrating an example technique fordetermining gain values for one or more posture states, in accordancewith one or more techniques of this disclosure.

FIG. 8 is a diagram illustrating an example technique for adjustingelectrical stimulation therapy.

FIG. 9 is a flowchart illustrating an example operation for controllingstimulation, in accordance with one or more techniques of thisdisclosure.

FIG. 10 is a graph illustrating a relationship between sensed ECAPvoltage amplitude and stimulation current amplitude, in accordance withone or more techniques of this disclosure.

Like reference characters denote like elements throughout thedescription and figures.

DETAILED DESCRIPTION

The disclosure describes examples of medical devices, systems, andtechniques for adjusting electrical stimulation delivered to a patientbased on ECAP characteristic values. Electrical stimulation therapy istypically delivered to a target tissue (e.g., nerves of the spinal cordor muscle) of a patient via two or more electrodes. Parameters of theelectrical stimulation therapy (e.g., electrode combination, voltage orcurrent amplitude, pulse width, pulse frequency, etc.) are selected by aclinician and/or the patient to provide relief from various symptoms,such as pain, nervous system disorders, muscle disorders, etc. However,as the patient moves, the distance between the electrodes and the targettissues changes. Since neural recruitment at the nerves is a function ofstimulation intensity (e.g., amplitude and/or pulse frequency) anddistance between the target tissue and the electrodes, movement of theelectrode closer to the target tissue may result in increased neuralrecruitment (e.g., possible painful sensations or adverse motorfunction), and movement of the electrode further from the target tissuemay result in decreased efficacy of the therapy for the patient. Certainpatient postures (which may or may not include patient activity) may berepresentative of respective distances (or changes in distance) betweenelectrodes and nerves and thus be an informative feedback variable formodulating stimulation therapy.

In some examples, a patient may experience discomfort or pain caused bytransient patient conditions, which is referred to herein as transientoverstimulation. The electrodes can move closer to the target tissue fora number of reasons including coughing, sneezing, laughing, valsalvamaneuvers, leg lifting, cervical motions, deep breathing, or anothertransient patient movement. If a system is delivering stimulation duringthese movements, the patient may perceive the stimulation as stronger(and possibly uncomfortable) due to the decreased distance betweenelectrodes and target tissue in a short amount of time. Although apatient may anticipate such movements and preemptively reducestimulation intensity in an attempt to avoid these uncomfortablesensations, these patient actions interfere with normal activities andmay not be sufficient to avoid uncomfortable stimulation at all times.

ECAPs are a measure of neural recruitment because each ECAP signalrepresents the superposition of electrical potentials generated from apopulation of axons firing in response to an electrical stimulus (e.g.,a stimulation pulse). Changes in a characteristic (e.g., an amplitude ofa portion of the signal or area under the curve of the signal) of ECAPsignals occur as a function of how many axons have been activated by thedelivered stimulation pulse. For a given set of parameter values thatdefine the stimulation pulse and a given distance between the electrodesand target nerve, the detected ECAP signal may have a certaincharacteristic value (e.g., amplitude, or area under a curve).Therefore, a system can determine that the distance between electrodesand nerves has increased or decreased in response to determining thatthe measured ECAP characteristic value has increased or decreased. Forexample, if the set of parameter values stays the same and the ECAPcharacteristic value of amplitude increases, the system can determinethat the distance between electrodes and the nerve has decreased.

In some examples, effective stimulation therapy may rely on a certainlevel of neural recruitment at a target nerve (e.g., at a target ECAPcharacteristic value or below a threshold ECAP characteristic value).This effective stimulation therapy may provide relief from one or moreconditions (e.g., patient perceived pain) without an unacceptable levelof side effects (e.g., overwhelming perception of stimulation). In orderto maintain effective stimulation therapy, a system may use thecharacteristic value of an ECAP signal as feedback for adjusting astimulation parameter (e.g., increase or decrease the stimulationparameter value) to increase or decrease the neural recruitment back tothe neural recruitment associated with effective stimulation therapy.However, the patient may have different sensitivities to increasingstimulation intensity and decreasing stimulation intensity. For example,the patient may be more sensitive to increasing stimulation intensity(e.g., increasing a current amplitude value in a subsequent pulse) thandecreasing stimulation intensity (e.g., decreasing a current amplitudevalue in a subsequent pulse). Without tailoring changes to stimulationparameter values to account for increasing or decreasing stimulationintensity of stimulation pulses, the system may not efficiently achievethe desired neural recruitment levels for the patient (e.g., causepatient discomfort or reduce therapy efficacy). Therefore, a system mayemploy different gain values for increasing stimulation intensity anddecreasing stimulation intensity, as determined by the differencebetween a target ECAP characteristic value and the detected ECAPcharacteristic value (e.g., an ECAP differential value).

Moreover, if the patient changes posture or otherwise engages inphysical activity, the distance between the electrodes and the nervechanges as well. This change in distance can cause loss of effectivetherapy and/or side effects if the parameter values that definestimulation are not adjusted to compensate for the change in distance.The different distance between electrodes and the target nerve (e.g.,caused by a shift from one posture state to another) may also result indifferent sensitivities to stimulation intensity (e.g., smallerdistances may result in greater sensitivities to changes in stimulationintensity). If a system does not adjust the control policy for thesechanges, adjustments to stimulation parameter values may not besufficient to maintain effective therapy or may provide stimulation thatis too strong at that posture state. Therefore, it may be beneficial tomaintain effective therapy by the system adjusting how stimulationintensity is changed within a given posture state and/or changing targetECAP characteristic values when a posture state of the patient haschanged.

As described herein, systems, devices, and techniques provide solutionsto one or more of the above-referenced issues by adjusting electricalstimulation therapy delivered to a patient using different gain valuesfor increasing stimulation intensity and decreasing stimulationintensity of stimulation pulses. When a patient moves, the distancebetween implanted electrodes and target nerves changes. The system maymonitor one or more characteristic values that represent detected ECAPsignals and adjust a stimulation parameter value based on a selectedECAP characteristic value, such as an attempt to achieve a target ECAPcharacteristic value and/or avoid a threshold ECAP characteristic value.

When adjusting the stimulation parameter value in response todetermining that a characteristic value of a detected ECAP signal isbelow or above the target ECAP characteristic value, the system mayemploy a gain value that represents the magnitude, or rate, of changeapplied to a stimulation parameter in order to achieve the target ECAPcharacteristic value, for example. However, as discussed above, neuralrecruitment may change differently for increasing stimulation intensityand decreasing stimulation intensity, which changes patient sensitivityto these different types of intensity changes. Therefore, the system mayemploy a gain value for adjusting the stimulation parameter to increasestimulation intensity that is different than the gain value foradjusting the stimulation parameter to decease stimulation intensity.Using these different gain values, the system can then increase ordecrease a stimulation parameter according to the selected gain value inorder to maintain the target ECAP characteristic value.

In some examples, the gain value may be a multiplier applied to adifference between a target ECAP characteristic value and a detectedECAP characteristic value. If the gain value is constant, the result isa stimulation parameter value that changes linearly. For example, thesystem may select one gain value for any detected ECAP characteristicvalue that is less than the target ECAP characteristic value, and thesystem may select a different gain value for any detected ECAPcharacteristic value that is greater than the target ECAP characteristicvalue. In other examples, the gain value may be calculated using afunction that may be linear or non-linear. Put another way, for a giveninput or set of inputs (e.g., the detected ECAP characteristic valueand/or posture state may be an input that affects the calculated gainvalue) the system may calculate different gain values for increasingstimulation intensity and/or decreasing stimulation intensity.

In one example, the system may determine a gain value that changes fordifferent sensed ECAP characteristic values or different differencesbetween the sensed ECAP characteristic value and a target ECAPcharacteristic value. A changing gain value (via a linear or non-linearfunction) would result in a non-linear function that determines theadjusted stimulation parameter (e.g., the output of the non-linearfunction). For example, the system may adjust the stimulation parametervalue exponentially or logarithmically according to the differencebetween the sensed ECAP characteristic value and the threshold ECAPamplitude. In one example, the gain value is calculated by multiplyingthe difference between the sensed ECAP characteristic value and thethreshold ECAP amplitude to a multiplier (e.g., a linear function) suchthat the gain value changes according to that difference between thesensed ECAP characteristic value and the threshold ECAP amplitude. Insome examples, the gain value may represent a value selected from atable that stores gain values for respective difference values betweenthe sensed ECAP characteristic value and the threshold ECAP amplitude.The table may result in a linear or non-linear function for determiningthe next stimulation parameter value.

For example, a larger gain value will cause the system to make a largeradjustment to the stimulation parameter for the same stimulation pulsethan the adjustment resulting from a smaller gain value. For anon-linear function this comparison in gain value can be made relativeto the same value for the difference between the sensed ECAPcharacteristic value and the threshold ECAP amplitude (e.g., the valuedifference representing an input value to the gain function). Thus, fora given input value of the gain function (or set of input values) thecorresponding gain value (or set of gain values) is changed. For ease ofdiscussion, various examples discuss the change in gain value relativeto a linear function. It is understood that a non-linear function mayalso be used in such embodiments, where the relative change in gainvalue is thereby relative to the same value for the difference betweenthe sensed ECAP characteristic value and the threshold ECAP amplitude.Generally, a larger gain value may be employed when decreasing a currentamplitude value because the patient may be less sensitive to decreasesin stimulation intensity. Conversely, a smaller gain value will causethe system to make a smaller adjustment to the stimulation parameter forthe next stimulation pulse than a larger gain value. This smaller gainvalue may be employed when increasing a current amplitude value becausethe patient may be more sensitive to increases in stimulation intensity.Without different gain values for different changes to stimulationintensity, a system may respond too slowly or too quickly withadjustments to stimulation parameter values. If the gain value is toolarge, the system may overcorrect a stimulation parameter value (e.g.,cause an uncomfortable sensation or reduce therapy efficacy). If thegain value is too small, the system may require many iterations ofadjustments to the stimulation parameter before the appropriatestimulation intensity is provided (e.g., also causing a prolongeduncomfortable sensation or a prolonged period of ineffective therapy).In this manner, a single gain value employed for both increasing anddecreasing stimulation intensity may be less effective for closed-loopstimulation than different gain values selected for specific changes tostimulation intensity.

The system may store or otherwise obtain gain values, growth curves,target ECAP characteristic values, or other factors that affectmodulation of stimulation associated with respective posture states. Forexample, the gain values may be inversely proportional to respectivegrowth curves for increasing and decreasing stimulation intensity.Electrical stimulation may be delivered to a patient by the medicaldevice in a train of stimulation pulses, and parameters that define thestimulation pulses may include pulse amplitude (current and/or voltage),pulse frequency, pulse width, pulse shape, and/or electrode combination.The system may alter, adjust, change, or otherwise modulate one or moreparameters of the stimulation pulses over time in order to maintain adesired level of stimulation efficacy for the patient.

In addition, to different gain values for different adjustments tostimulation intensity, the system may also select gain values specificto respective posture states. For example, electrodes implanted alongthe spinal column move to a position closer to the spinal cord when asubject lies in a supine posture state as compared to a position fartherfrom the spinal cord when the subject assumes a standing posture state.Since posture state affects the distance between the electrodes andtarget nerve, the system may detect or otherwise obtain the currentposture state of the patient and adjust one or more aspects of thecontrol policy employed by the system to modulate stimulation therapy inresponse to detected ECAP signals. A posture state may refer to apatient posture, an activity level, or a combination of patient postureand activity level. In some examples, the system may select a therapyprogram or set of stimulation parameter values according to the detectedposture state of the patient.

For example, a larger gain value will cause the system to make a largeradjustment to the stimulation parameter for the next stimulation pulsethan a smaller gain value. Without different gain values for differentposture states, a system may respond too slowly or too quickly withadjustments to stimulation parameter values. If the gain value is toolarge for the posture state, the system may overcorrect a stimulationparameter value (e.g., cause an uncomfortable sensation or reducetherapy efficacy). If the gain value is too small for the posture state,the system may require many iterations of adjustments to the stimulationparameter before the appropriate stimulation intensity is provided(e.g., also causing a prolonged uncomfortable sensation or a prolongedperiod of ineffective therapy). Generally, posture states associatedwith farther distances between the electrodes and target nerve maygenerally have larger gain values than posture states associated withcloser distances between the electrodes and target nerve. In thismanner, smaller gain values may be associated with smaller distancesbetween electrodes and the target nerve (e.g., posture states moresensitive to changes in stimulation intensity such as a supine posturestate). Conversely, larger gain values may be associated with largerdistances between electrodes and the target nerve (e.g., posture statesless sensitive to changes in stimulation intensity such as a proneposture state). A gain value may be inversely proportional to a growthcurve for a particular posture state, wherein the growth curve may be abest fit curve or line of ECAP characteristic values (e.g., voltageamplitude) for given stimulation parameter values (e.g., a currentamplitude of the respective pulses that elicited respective ECAPsignals). Since different changes to stimulation intensity and differentposture states may be associated with different gain values, the systemmay employ a set of different gain values for each posture state (e.g.,gain values for increasing stimulation intensity and decreasingstimulation intensity for each posture state). In some examples, thetarget ECAP characteristic value may be the same for some or all posturestates, but the target ECAP characteristic value may be differentbetween posture states in other examples.

In another type of control policy (e.g., type of closed-loop feedbackscheme), the system may employ a threshold ECAP characteristic valueinstead of a target ECAP characteristic value. The system may monitorcharacteristic values for sensed ECAP signals and reduce one or morestimulation parameter values from a predetermined value only in responseto the characteristic value exceeding the threshold ECAP characteristicvalue. In other words, the system may be configured to attempt to keepcharacteristic values of sensed ECAP signals below the threshold ECAPcharacteristic value and only increase the stimulation parameter back upto the predetermined value in response to the characteristic valuedropping back below the threshold ECAP characteristic value. In someexamples, the system may select the gain value used for adjusting thestimulation parameter according to whether the system needs to increaseor decrease the stimulation intensity and/or the current posture stateof the patient. In addition, or alternatively, the system may select thethreshold ECAP characteristic value according to the detected posturestate of the patient.

In some examples, stimulation parameter values may be predeterminedand/or automatically adjusted by the system based on characteristicvalues of ECAP signals, whether the system needs to increase or decreasestimulation intensity, posture states, and other types of feedback. Anexternal programmer for an IMD may provide a variety of features tosupport association of stimulation parameter values and/orcharacteristic values of ECAP signals with different posture states. Asone example, the programmer may receive user input indicating theposture state that the patient is occupying and associated ECAP signals,and/or corresponding characteristic values, with that posture state. Asanother example, a patient may indicate a value for a previouslyundefined stimulation parameter value for a defined posture state whilethe patient is in the posture state or transitioning to the posturestate. The indicated value may be defined for the posture state. Asanother example, a user may link multiple posture states and select aset of stimulation parameter values for delivery of therapy for each ofthe linked posture states. In this manner, it may not be necessary tospecify separate sets of stimulation parameter values for eachindividual posture state.

In some examples, a medical device, e.g., an implantable medical device(IMD), that delivers electrical stimulation may also employ a posturestate detector (e.g., one or more sensors) that detects the patientposture state. In other examples, the IMD may receive data from one ormore a separate devices that sense the posture state of the patient. TheIMD may then adjust one or more stimulation parameters in response todifferent posture states as indicated by the posture state detector.

A user may define stimulation parameter values for delivery of therapyto a patient and associate the stimulation parameter values withmultiple posture states based on user input, e.g., simultaneously. Asanother example, upon storing a set of pre-established posture statedefinitions for delivery of posture state-responsive therapy, a devicemay permit a patient to submit a request via a patient programmer toupdate the set of pre-established posture state definitions. Forexample, programmer may be configured to receive user input changing thedefinitions of one or more posture states. In addition, a posture statedefinition may be modified based on user therapy adjustments and/orposture state information. In some cases, the posture state may beexpanded and split. In other cases, the posture state may be reduced insize based on posture state information. Hence, using one or more of thefeatures described in this disclosure, stimulation parameter values maybe flexibly, conveniently, and efficiently specified for various posturestates, including predetermined posture states and patient-createdposture states.

Although electrical stimulation is generally described herein in theform of electrical stimulation pulses, electrical stimulation may bedelivered in non-pulse form in other examples. For example, electricalstimulation may be delivered as a signal having various waveform shapes,frequencies, and amplitudes. Therefore, electrical stimulation in theform of a non-pulse signal may be a continuous signal than may have asinusoidal waveform or other continuous waveform.

FIG. 1 is a conceptual diagram illustrating example system 100 thatincludes implantable medical device (IMD) 110 to deliver electricalstimulation therapy to patient 102. Although the techniques described inthis disclosure are generally applicable to a variety of medical devicesincluding external devices and IMDs, application of such techniques toIMDs and, more particularly, implantable electrical stimulators (e.g.,neurostimulators) will be described for purposes of illustration. Moreparticularly, the disclosure will refer to an implantable SCS system forpurposes of illustration, but without limitation as to other types ofmedical devices or other therapeutic applications of medical devices.

As shown in FIG. 1 , system 100 includes an IMD 110, leads 108A and108B, and external programmer 104 shown in conjunction with a patient102, who is ordinarily a human patient. In the example of FIG. 1 , IMD110 is an implantable electrical stimulator that is configured togenerate and deliver electrical stimulation therapy to patient 102 viaone or more electrodes of electrodes of leads 108A and/or 108B(collectively, “leads 108”), e.g., for relief of chronic pain or othersymptoms. In other examples, IMD 110 may be coupled to a single leadcarrying multiple electrodes or more than two leads each carryingmultiple electrodes. In some examples, the stimulation signals, orpulses, may be configured to elicit detectable ECAP signals that IMD 110may use to determine the posture state occupied by patient 102 and/ordetermine how to adjust one or more parameters that define stimulationtherapy. IMD 110 may be a chronic electrical stimulator that remainsimplanted within patient 102 for weeks, months, or even years. In otherexamples, IMD 110 may be a temporary, or trial, stimulator used toscreen or evaluate the efficacy of electrical stimulation for chronictherapy. In one example, IMD 110 is implanted within patient 102, whilein another example, IMD 110 is an external device coupled topercutaneously implanted leads. In some examples, IMD 110 uses one ormore leads, while in other examples, IMB 110 is leadless.

IMD 110 may be constructed of any polymer, metal, or composite materialsufficient to house the components of IMD 110 (e.g., componentsillustrated in FIG. 2 ) within patient 102. In this example, IMD 110 maybe constructed with a biocompatible housing, such as titanium orstainless steel, or a polymeric material such as silicone, polyurethane,or a liquid crystal polymer, and surgically implanted at a site inpatient 102 near the pelvis, abdomen, or buttocks. In other examples,IMD 110 may be implanted within other suitable sites within patient 102,which may depend, for example, on the target site within patient 102 forthe delivery of electrical stimulation therapy. The outer housing of IMB110 may be configured to provide a hermetic seal for components, such asa rechargeable or non-rechargeable power source. In addition, in someexamples, the outer housing of IMD 110 is selected from a material thatfacilitates receiving energy to charge the rechargeable power source.

Electrical stimulation energy, which may be constant current or constantvoltage-based pulses, for example, is delivered from IMD 110 to one ormore target tissue sites of patient 102 via one or more electrodes (notshown) of implantable leads 108. In the example of FIG. 1 , leads 108carry electrodes that are placed adjacent to the target tissue of spinalcord 106. One or more of the electrodes may be disposed at a distal tipof a lead 108 and/or at other positions at intermediate points along thelead. Leads 108 may be implanted and coupled to IMD 110. The electrodesmay transfer electrical stimulation generated by an electricalstimulation generator in IMD 110 to tissue of patient 102. Althoughleads 108 may each be a single lead, lead 108 may include a leadextension or other segments that may aid in implantation or positioningof lead 108. In some other examples, IMD 110 may be a leadlessstimulator with one or more arrays of electrodes arranged on a housingof the stimulator rather than leads that extend from the housing. Inaddition, in some other examples, system 100 may include one lead ormore than two leads, each coupled to IMD 110 and directed to similar ordifferent target tissue sites.

The electrodes of leads 108 may be electrode pads on a paddle lead,circular (e.g., ring) electrodes surrounding the body of the lead,conformable electrodes, cuff electrodes, segmented electrodes (e.g.,electrodes disposed at different circumferential positions around thelead instead of a continuous ring electrode), any combination thereof(e.g., ring electrodes and segmented electrodes) or any other type ofelectrodes capable of forming unipolar, bipolar or multipolar electrodecombinations for therapy. Ring electrodes arranged at different axialpositions at the distal ends of lead 108 will be described for purposesof illustration.

The deployment of electrodes via leads 108 is described for purposes ofillustration, but arrays of electrodes may be deployed in differentways. For example, a housing associated with a leadless stimulator maycarry arrays of electrodes, e.g., rows and/or columns (or otherpatterns), to which shifting operations may be applied. Such electrodesmay be arranged as surface electrodes, ring electrodes, or protrusions.As a further alternative, electrode arrays may be formed by rows and/orcolumns of electrodes on one or more paddle leads. In some examples,electrode arrays include electrode segments, which are arranged atrespective positions around a periphery of a lead, e.g., arranged in theform of one or more segmented rings around a circumference of acylindrical lead. In other examples, one or more of leads 108 are linearleads having 8 ring electrodes along the axial length of the lead. Inanother example, the electrodes are segmented rings arranged in a linearfashion along the axial length of the lead and at the periphery of thelead.

The stimulation parameter set of a therapy stimulation program thatdefines the stimulation pulses of electrical stimulation therapy by IMD110 through the electrodes of leads 108 may include informationidentifying which electrodes have been selected for delivery ofstimulation according to a stimulation program, the polarities of theselected electrodes, i.e., the electrode combination for the program,voltage or current amplitude, pulse frequency, pulse width, pulse shapeof stimulation delivered by the electrodes. These stimulation parametersvalues that make up the stimulation parameter set that defines pulsesmay be predetermined parameter values defined by a user and/orautomatically determined by system 100 based on one or more factors oruser input.

Although FIG. 1 is directed to SCS therapy, e.g., used to treat pain, inother examples system 100 may be configured to treat any other conditionthat may benefit from electrical stimulation therapy. For example,system 100 may be used to treat tremor, Parkinson's disease, epilepsy, apelvic floor disorder (e.g., urinary incontinence or other bladderdysfunction, fecal incontinence, pelvic pain, bowel dysfunction, orsexual dysfunction), obesity, gastroparesis, or psychiatric disorders(e.g., depression, mania, obsessive compulsive disorder, anxietydisorders, and the like). In this manner, system 100 may be configuredto provide therapy taking the form of deep brain stimulation (DBS),peripheral nerve stimulation (PNS), peripheral nerve field stimulation(PNFS), cortical stimulation (CS), pelvic floor stimulation,gastrointestinal stimulation, or any other stimulation therapy capableof treating a condition of patient 102.

In some examples, lead 108 includes one or more sensors configured toallow IMD 110 to monitor one or more parameters of patient 102, such aspatient activity, pressure, temperature, or other characteristics. Theone or more sensors may be provided in addition to, or in place of,therapy delivery by lead 108.

IMD 110 is generally configured to deliver electrical stimulationtherapy to patient 102 via selected combinations of electrodes carriedby one or both of leads 108, alone or in combination with an electrodecarried by or defined by an outer housing of IMD 110. The target tissuefor the electrical stimulation therapy may be any tissue affected byelectrical stimulation, which may be in the form of electricalstimulation pulses or continuous waveforms. In some examples, the targettissue includes nerves, smooth muscle or skeletal muscle. In the exampleillustrated by FIG. 1 , the target tissue is tissue proximate spinalcord 106, such as within an intrathecal space or epidural space ofspinal cord 106, or, in some examples, adjacent nerves that branch offspinal cord 106. Leads 108 may be introduced into spinal cord 106 in viaany suitable region, such as the thoracic, cervical or lumbar regions.Stimulation of spinal cord 106 may, for example, prevent pain signalsfrom traveling through spinal cord 106 and to the brain of patient 102.Patient 102 may perceive the interruption of pain signals as a reductionin pain and, therefore, efficacious therapy results. In other examples,stimulation of spinal cord 106 may produce paresthesia which may bereduce the perception of pain by patient 102, and thus, provideefficacious therapy results.

IMD 110 is configured to generate and deliver electrical stimulationtherapy to a target stimulation site within patient 102 via theelectrodes of leads 108 to patient 102 according to one or more therapystimulation programs. A therapy stimulation program defines values forone or more parameters (e.g., a parameter set) that define an aspect ofthe therapy delivered by IMD 110 according to that program. For example,a therapy stimulation program that controls delivery of stimulation byIMD 110 in the form of pulses may define values for voltage or currentpulse amplitude, pulse width, pulse rate (e.g., pulse frequency),electrode combination, pulse shape, etc. for stimulation pulsesdelivered by IMD 110 according to that program.

A user, such as a clinician or patient 102, may interact with a userinterface of an external programmer 104 to program IMD 110. Programmingof IMD 110 may refer generally to the generation and transfer ofcommands, programs, or other information to control the operation of IMD110. In this manner, IMD 110 may receive the transferred commands andprograms from external programmer 104 to control stimulation, such asstimulation pulses that provide electrical stimulation therapy. Forexample, external programmer 104 may transmit therapy stimulationprograms, stimulation parameter adjustments, therapy stimulation programselections, posture states, user input, or other information to controlthe operation of IMD 110, e.g., by wireless telemetry or wiredconnection.

In some cases, external programmer 104 may be characterized as aphysician or clinician programmer if it is primarily intended for use bya physician or clinician. In other cases, external programmer 104 may becharacterized as a patient programmer if it is primarily intended foruse by a patient. A patient programmer may be generally accessible topatient 102 and, in many cases, may be a portable device that mayaccompany patient 102 throughout the patient's daily routine. Forexample, a patient programmer may receive input from patient 102 whenthe patient wishes to terminate or change electrical stimulationtherapy, or when a patient perceives stimulation being delivered. Ingeneral, a physician or clinician programmer may support selection andgeneration of programs by a clinician for use by IMD 110, whereas apatient programmer may support adjustment and selection of such programsby a patient during ordinary use. In other examples, external programmer104 may include, or be part of, an external charging device thatrecharges a power source of IMD 110. In this manner, a user may programand charge IMD 110 using one device, or multiple devices.

As described herein, information may be transmitted between externalprogrammer 104 and IMD 110. Therefore, IMD 110 and external programmer104 may communicate via wireless communication using any techniquesknown in the art. Examples of communication techniques may include, forexample, radiofrequency (RF) telemetry and inductive coupling, but othertechniques are also contemplated. In some examples, external programmer104 includes a communication head that may be placed proximate to thepatient's body near the IMD 110 implant site to improve the quality orsecurity of communication between IMD 110 and external programmer 104.Communication between external programmer 104 and IMD 110 may occurduring power transmission or separate from power transmission.

In some examples, IMD 110, in response to commands from externalprogrammer 104, delivers electrical stimulation therapy according to aplurality of therapy stimulation programs to a target tissue site of thespinal cord 106 of patient 102 via electrodes (not depicted) on leads108. In some examples, IMD 110 modifies therapy stimulation programs astherapy needs of patient 102 evolve over time. For example, themodification of the therapy stimulation programs may cause theadjustment of at least one parameter of the plurality of stimulationpulses. When patient 102 receives the same therapy for an extendedperiod, the efficacy of the therapy may be reduced. In some cases,parameters of the plurality of stimulation pulses may be automaticallyupdated.

As described herein, IMD 110 may be configured to detect ECAP signalswhich are representative of the number of nerve fibers activated by adelivered stimulation signal (e.g., a delivered pulse). Since thedistance between electrodes and the target nerve changes for differentposture states (e.g., a static posture and/or activity component), acharacteristic value of one or more ECAP signals can be indicative ofthe posture state currently occupied when the one or more ECAP signalswere detected by IMD 110. In one example, IMD 110 may deliver aplurality of pulses defined by different parameter values and detect therespective ECAP signal elicited by each pulse. IMD 110 may determine arelationship between characteristic values from each ECAP signal and thedifferent parameter values of the pulses, and this relationship may bedifferent for each different posture state. In addition, thisrelationship may be different for characteristic values determined fromECAP signals elicited from stimulation pulses delivered with increasingstimulation intensity and those stimulation pulses delivered withdecreasing stimulation intensity. In one example, each relationship maybe a growth curve of the characteristic values of the ECAP (e.g., anamplitude of the ECAP signal) vs. values of a stimulation parameter(e.g., the current amplitude of the respective pulses) that elicitedeach ECAP signal from which the characteristic values were derived. Insome examples, one growth curve may indicate the relationship forstimulation pulses delivered with increasing stimulation intensity, andanother growth curve may indicate the relationship for stimulationpulses delivered with decreasing stimulation intensity. In addition,each posture state may have a respective set of growth curves that varyin slope and/or intercept for pulses delivered with increasing anddecreasing stimulation intensities. In some examples, gain values may bedetermined from the slope of each growth curve, wherein the gain valuemay be inversely proportional to the slope of the growth curve.

In this disclosure, efficacy of electrical stimulation therapy (e.g.,neural recruitment) may be indicated by one or more characteristics(e.g. an amplitude of or between one or more peaks or an area under thecurve of one or more peaks) of an action potential that is evoked by astimulation pulse delivered by IMD 110 (i.e., a characteristic value ofthe ECAP signal). Electrical stimulation therapy delivery by leads 108of IMD 110 may cause neurons within the target tissue to evoke acompound action potential that travels up and down the target tissue,eventually arriving at sensing electrodes of IMD 110. Furthermore,stimulation may also elicit at least one ECAP signal, and ECAPsresponsive to stimulation may also be a surrogate for the effectivenessof the therapy. The amount of action potentials (e.g., number of neuronspropagating action potential signals) that are evoked may be based onthe various parameters of electrical stimulation pulses such asamplitude, pulse width, frequency, pulse shape (e.g., slew rate at thebeginning and/or end of the pulse), etc. In addition, the amount ofaction potentials that are evoked may vary depending on whether theintensity of stimulation pulses is increasing or decreasing fromsuccessive pulses. The slew rate may define the rate of change of thevoltage and/or current amplitude of the pulse at the beginning and/orend of each pulse or each phase within the pulse. For example, a veryhigh slew rate indicates a steep or even near vertical edge of thepulse, and a low slew rate indicates a longer ramp up (or ramp down) inthe amplitude of the pulse. In some examples, these parameterscontribute to an intensity of the electrical stimulation. In addition, acharacteristic of the ECAP signal (e.g., an amplitude) may change basedon the distance between the stimulation electrodes and the nervessubject to the electrical field produced by the delivered stimulationpulses.

Some example techniques for adjusting stimulation parameter values forstimulation pulses (e.g., pulses that may or may not contribute totherapy for the patient) are based on comparing the value of acharacteristic of a measured ECAP signal to a target ECAP characteristicvalue. In response to delivering a stimulation pulse defined by a set ofstimulation parameter values, IMD 110, via two or more electrodesinterposed on leads 108, senses electrical potentials of tissue of thespinal cord 106 of patient 102 to measure the electrical activity of thetissue. IMD 110 senses ECAPs from the target tissue of patient 102,e.g., with electrodes on one or more leads 108 and associated sensecircuitry. In some examples, IMD 110 receives a signal indicative of theECAP from one or more sensors, e.g., one or more electrodes andcircuitry, internal or external to patient 102. Such an example signalmay include a signal indicating an ECAP of the tissue of patient 102.Examples of the one or more sensors include one or more sensorsconfigured to measure a compound action potential of patient 102, or aphysiological effect indicative of a compound action potential. Forexample, to measure a physiological effect of a compound actionpotential, the one or more sensors may be an accelerometer, a pressuresensor, a bending sensor, a sensor configured to detect a posture ofpatient 102, or a sensor configured to detect a respiratory function ofpatient 102. However, in other examples, external programmer 104receives a signal indicating a compound action potential in the targettissue of patient 102 and transmits a notification to IMD 110.

In the example of FIG. 1 , IMD 110 is described as performing aplurality of processing and computing functions. However, externalprogrammer 104 instead may perform one, several, or all of thesefunctions. In this alternative example, IMD 110 functions to relaysensed signals to external programmer 104 for analysis, and externalprogrammer 104 transmits instructions to IMD 110 to adjust the one ormore parameters defining the electrical stimulation therapy based onanalysis of the sensed signals. For example, IMD 110 may relay thesensed signal indicative of an ECAP to external programmer 104. Externalprogrammer 104 may compare the parameter value of the ECAP to the targetECAP characteristic value, and in response to the comparison, externalprogrammer 104 may instruct IMD 110 to adjust one or more stimulationparameter that defines the electrical stimulation informed pulses and,in some examples, control pulses, delivered to patient 102.

In some examples, the system changes the target ECAP characteristicvalue and/or growth rate(s) over a period of time, such as according toa change to a stimulation threshold (e.g., a perception threshold ordetection threshold specific for the patient). The system may beprogrammed to change the target ECAP characteristic in order to adjustthe intensity of informed pulses to provide varying sensations to thepatient (e.g., increase or decrease the volume of neural activation).Although the system may change the target ECAP characteristic value,received ECAP signals may still be used by the system to adjust one ormore parameter values of the informed pulses and/or control pulses inorder to meet the target ECAP characteristic value.

One or more devices within system 100, such as IMD 110 and/or externalprogrammer 104, may perform various functions as described herein. Forexample, IMD 110 may include stimulation circuitry configured to deliverelectrical stimulation, sensing circuitry configured to sense aplurality ECAP signals, and processing circuitry. The processingcircuitry may be configured to control the stimulation circuitry todeliver a plurality of electrical stimulation pulses having differentamplitude values and control the sensing circuitry to detect, afterdelivery of each electrical stimulation pulse of the plurality ofelectrical stimulation pulses, a respective ECAP signal of the pluralityof ECAP signals. The processing circuitry of IMD 110 may then determine,based on the plurality of ECAP signals, a posture state of the patient.

As described herein, IMD 110 may modulate or adjust one or morestimulation parameters that at least partially define electricalstimulation, and IMD 110 may adjust the one or more stimulationparameters based on whether or not stimulation intensity is to beincreased or decreased, and in some examples, also based on a detectedposture state of the patient 102. For example, IMD 110 may select a gainvalue according to whether or not IMD 110 needs to increase or decreasestimulation intensity according to the detected ECAP characteristicvalue (e.g., an ECAP differential value indicating a positive ornegative relationship between the detected ECAP characteristic value anda target ECAP characteristic value). IMD 110 may also use the detectedposture state to determine how to employ ECAP signals in a closed-loopfeedback system for adjusting stimulation parameters. In one example,IMD 110 includes stimulation generation circuitry configured to generateand deliver electrical stimulation to patient 102 according one or moresets of stimulation parameters that at least partially define the pulsesof the electrical stimulation. Each set of stimulation parameters mayinclude at least one of an amplitude, a pulse width, a pulse frequency,or a pulse shape.

IMD 110 may include sensing circuitry configured to sense an ECAP signalelicited by delivered electrical stimulation, such as a stimulationpulse. IMD 110 may also include processing circuitry configured tocontrol stimulation circuitry to deliver a first electrical stimulationpulse to patient 102 according to a first value of a stimulationparameter and determine a characteristic value of the ECAP signalelicited from the electrical stimulation. IMD 110 may then determine anECAP differential value that indicates whether the characteristic valueof the ECAP signal elicited by the first electrical stimulation pulse isone of greater than a selected ECAP characteristic value or less thanthe selected ECAP characteristic value. For example, IMD 110 may comparethe characteristic value of the ECAP signal to the selected ECAPcharacteristic value, and the comparison may indicate whether IMD 110may need to increase or decrease stimulation intensity of stimulationpulses in order to achieve the selected ECAP characteristic value (e.g.,a target ECAP characteristic value).

Based on the ECAP differential value, IMD 110 may determine a gain valueto use for adjusting a stimulation parameter value for subsequentstimulation pulses. For example, IMD 110 may select one gain value foradjusting a stimulation parameter value to increase stimulationintensity or select a different gain value for adjusting the stimulationparameter value to decrease stimulation intensity. Using the gain value,IMD 110 may then determine the parameter value that will at leastpartially define a second electrical stimulation pulse and control thestimulation circuitry to deliver the second electrical stimulation pulseaccording to the parameter value. In this manner, IMD 110 can use theselected gain value to determine one or more stimulation parametervalues for the next stimulation pulses to be delivered to patient 102.In some examples, IMD 110 may adjust a previous stimulation parametervalue to achieve the new parameter value based on the selected gainvalue.

As discussed above, IMD 110 may use different gain values to adjust astimulation parameter value, where IMD 110 may select the specific gainvalue for adjusting the stimulation parameter value to increase ordecrease stimulation intensity. Since neural recruitment, and patientsensitivity, may be different when increasing stimulation intensity ordecreasing stimulation intensity, the different gain values may beemployed by IMD 110 to more precisely adjust a stimulation parametervalue. For example, increasing stimulation intensity may cause increasedneural recruitment at a faster rate than the rate of change in neuralrecruitment when decreasing stimulation intensity. In one example, IMDmay determine the ECAP differential value by determining a positive ECAPdifferential value for the characteristic value being less than theselected ECAP characteristic value. In this manner, the positive ECAPdifferential value indicates that the neural recruitment is less thanthe target, and IMD 110 should increase stimulation intensity ofsubsequent pulses to increase neural recruitment. Responsive todetermining the positive ECAP differential value, IMD 110 may select afirst gain value from a plurality of gain values, wherein the first gainvalue is associated with the positive ECAP differential value. Thisfirst gain value may be less than a second gain value associated with anegative ECAP differential value. Since the first gain value is lowerthan the second gain value, IMD 110 will make a smaller change to thestimulation parameter value for subsequent stimulation pulses.Conversely, IMD 110 may determine the ECAP differential value bydetermining a negative ECAP differential value for the characteristicvalue being greater than the selected ECAP characteristic value. In thismanner, the negative ECAP differential value indicates that the neuralrecruitment is greater than the target, and IMD 110 should decreasestimulation intensity of subsequent pulses to decrease neuralrecruitment. Responsive to determining the negative ECAP differentialvalue, IMD 110 may select the second gain value from the plurality ofgain values, wherein the first gain value is associated the negativeECAP differential value. Since the second gain value is higher than thefirst gain value, IMD 110 will make a larger change to the stimulationparameter value for subsequent stimulation pulses.

In some examples, IMD 110 may select, based on the ECAP differentialvalue, a growth curve from a plurality of growth curves. Each growthcurve may represent a relationship of ECAP characteristic values to aplurality of different values for a stimulation parameter. Since neuralrecruitment may vary depending on whether stimulation intensity isincreasing or decreasing, the plurality of growth curves may includeseparate growth curves for the relationship of the ECAP characteristicvalues for when the stimulation parameter value is increasing and therelationship of the ECAP characteristic values for when the stimulationparameter value is decreasing. IMD 110 may determine the gain value foreach growth curve as being inversely proportional to a slope of thegrowth curve.

IMD 110 may determine the growth curves for patient 102. For example,IMD 110 may perform an initial calibration, or subsequent calibration,of the growth curves using respective sweeps of stimulation pulses. IMD110 may control the stimulation circuitry to deliver a plurality ofelectrical stimulation pulses as a sweep of pulses comprisingiteratively increasing and decreasing stimulation parameter values, suchas iteratively increasing amplitude values and iteratively decreasingamplitude values. IMD 110 may increase the amplitude values and thendecrease amplitude values, or vice versa. Typically, the increasingand/or decreasing amplitude values may be bound by a discomfortthreshold or other threshold that limits the stimulation intensity. IMD110 may determine a first growth curve associated with the increasingamplitude values and determine a second growth curve associated with thedecreasing amplitude values. IMD 110 may also determine respective gainvalues from each of the first and second growth curves. In someexamples, IMD 110 may use these two growth curves and/or gain values forany posture state of the patient. In other examples, IMD 110 may performthis sweep for each posture state of a plurality of posture states inorder for IMD 110 may select the gain value that is associated withincreasing or decreasing stimulation intensity and the current posturestate of the patient.

Accordingly, IMD 110 may be configured to select, based on the ECAPdifferential value and a posture state of the patient at a time thesensing circuitry detected the ECAP signal, the gain value from aplurality of gain values. Each posture state of a plurality of posturestates may be associated with two gain values of the plurality of gainvalues, where each gain value of the two gain values is associated witha respective positive ECAP differential value or negative ECAPdifferential value. IMD 110 may thus receive, from a sensor, a posturestate signal representing a posture state of the patient. IMD 110 maythen determine, based on the posture state signal, a gain value for thestimulation parameter selected according to whether the stimulationintensity is to be increased or decreased, and adjust, based on thecharacteristic value of the ECAP signal and the gain value, the firstvalue of the stimulation parameter to a second value of the stimulationparameter. IMD 110 may then control subsequent delivery of theelectrical stimulation according to the second value of the stimulationparameter.

In some examples, the processing circuitry of IMD 110 may be configuredto adjust the stimulation parameter by one of increasing or decreasingthe stimulation parameter of the electrical stimulation based on agrowth curve associated with the posture state of the patient. Asdiscussed herein, the growth curve may represent a relationship betweenone or more parameters of delivered stimulation pulses and acharacteristic of ECAP signals. For example, the characteristic may bean amplitude of the ECAP signals (e.g., an amplitude between an N1 peakand a P2 peak of the ECAP signal), an area under one or more peaks ofthe ECAP signal, or some other metric indicative of the nerve activationthat resulted in the ECAP signal. In some examples, the gain value maybe inversely proportional to a slope of the growth curve.

When IMD 110 is configured to modulate stimulation pulses in order tomaintain consistent nerve activation, such as increasing and decreasinga stimulation parameter to maintain a target ECAP characteristic value,IMD 110 may perform an example process. For example, IMD 110 may monitoran amplitude that is the characteristic value of the detected ECAPsignal. IMD 110 may adjust the first value to the second value of thestimulation parameter by subtracting the amplitude from a target ECAPamplitude value for the patient to generate a differential amplitude(e.g., an ECAP differential value). The differential amplitude is thedifference between the detected amplitude and the target ECAP amplitudevalue. IMD 110 may then multiply the differential amplitude by the gainvalue that at least partially defines the electrical stimulation togenerate a differential value. The gain value may be a multiplier orfraction selected based on whether the ECAP differential value ispositive or negative, and in some examples, the detected posture state.A larger gain value may be associated with posture states at which thedistance between electrodes and the target nerve is larger because thedistance causes less sensitivity for changes in stimulation pulseintensity. IMD 110 may then add the differential value to a previousamplitude value (e.g., the amplitude value of the last stimulation pulsethat was delivered or elicited the ECAP signal) to generate the secondvalue that at least partially defines the next stimulation pulses to bedelivered to patient 102.

In other examples, IMD 110 may not attempt to maintain consistent nerveactivation by modulating stimulation pulses to achieve a target ECAPcharacteristic value. Instead, IMD 110 may monitor characteristic valuesof ECAP signals any only take action when the characteristic valueexceeds a threshold ECAP characteristic value. Characteristic valuesexceeding the threshold ECAP characteristic values may be indicative ofincreased stimulation perception that may be above an uncomfortablethreshold or pain threshold for the patient. Therefore, reducingstimulation pulse intensity when the characteristic value exceeds thislevel of stimulation may reduce the likelihood that patient 102experiences any uncomfortable sensations that may occur as a result ofposture state changes or any transient movement. For example, IMD 110may be configured to compare the characteristic value of the ECAP signalto a threshold ECAP characteristic value and determine that thecharacteristic value of the ECAP signal is greater than the thresholdECAP characteristic value (e.g., a positive ECAP differential value).Responsive to determining that the characteristic value of the ECAPsignal is greater than the threshold ECAP characteristic value, IMD 110may be configured to decrease the first value to the second value forthe stimulation parameter of a subsequent stimulation pulse. Asdiscussed above, IMD 110 may apply a gain value that is associated withthe positive ECAP differential value or a negative ECAP differentialvalue.

IMD 110 may continue to decrease the stimulation parameter value as longas the ECAP characteristic value continues to exceed the threshold ECAPcharacteristic value. Once, the stimulation parameter has beendecreased, IMD 110 may attempt to increase the stimulation parametervalue again back up to the predetermined first value intended for thestimulation pulses. IMD 110 may be configured to determine a othercharacteristic values of subsequent ECAP signals elicited fromelectrical stimulation pulses delivered after sensing the first ECAPsignal. In response to determining that another characteristic value ofthe subsequent ECAP signals decreases below the threshold ECAPcharacteristic value, IMD 110 may then increase the value of thestimulation parameter back up to a value limited to be less than orequal to the first value (e.g., back up to the predetermined value forstimulation pulses that may be determined by a set of stimulationparameters or therapy program). Again, IMD 110 may use a different gainvalue to increase the stimulation parameter than the gain value used todecrease the stimulation parameter. In some examples, IMD 110 mayiteratively increase the stimulation parameter value until the firstvalue, or original value, is again reached after the characteristicvalues of the ECAP signal remain below the threshold ECAP characteristicvalue. IMD 110 may increase the stimulation parameter values at a slowerrate than the stimulation parameter values are decreased, but, in otherexamples, IMD 110 may increase and decrease the stimulation parametersat the same rates.

The detected posture state may be one posture state of a plurality ofposture states. In some examples, each posture state may be associatedwith a respective growth curve representing the relationship between theECAP values and stimulation parameter values when the patient occupiesthat particular posture state. In some examples, IMD 110 may select,based on the posture state signal, the gain value from a plurality ofgain values associated with respective posture states. The gain valuemay represent at least one of an increment rate (e.g., how fast IMD 110should increase the stimulation parameter value) or a decrement rate(e.g., how slow IMD 110 should decrease the stimulation parameter value)for the stimulation parameter that at least partially defines electricalstimulation pulses. In other examples, the gain value may represent aparticular magnitude that IMD 110 should increment or decrement aprevious parameter value each time IMD 110 increases or decrease theparameter value. This particular magnitude may effectively result in arate of change at which IMD 110 can adjust a stimulation parametervalue. In addition, or alternatively, IMD 110 may select the target ECAPcharacteristic value or the threshold ECAP characteristic valueaccording to the detected posture state. A patient may or may notbenefit from posture state specific target or threshold ECAPcharacteristic values.

IMD 110 may sense the posture state of patient 102 at predeterminedintervals or during predetermined periods of time. In some examples, IMD110 may sense the posture state in response to a trigger event, such asa patient-requested change in stimulation therapy, a sensed eventrepresentative of a patient condition such as pain, or any othertriggers. In some examples, IMD 110 may modulate posture state sensingfrequency based on whether or not posture state changes are detected.For example, IMD 110 may determine, from at least the signalrepresenting the posture state of the patient, that the posture state ofthe patient has changed. Responsive to determining that the posturestate has changed, IMD 110 may change at least one of an ECAP sensingfrequency. IMD 110 may increase posture state sensing frequency whenmore posture state changes are expected and decrease posture statesensing frequency when fewer posture state changes are expected. Sensingfrequency may refer to sensor sampling frequency and/or frequency atwhich processing circuitry analyzes data obtained from one or moresensors. In this manner, IMD 110 may modulate sensing frequency toconserve power consumption or otherwise reduce processing tasks.

As discussed herein, some example techniques for adjusting stimulationparameter values for electrical stimulation signals are based oncomparing the value of a characteristic of a measured ECAP signal to atarget ECAP characteristic value or using stimulation parameter valuesat a determined target ECAP characteristic to inform adjustment of oneor more parameter values to maintain the target ECAP according to knownrelationships between parameters. For example, during delivery of anelectrical stimulation signal, IMD 110, via two or more electrodesinterposed on leads 108, senses electrical potentials of tissue of thespinal cord 106 of patient 102 to measure the electrical activity of thetissue. IMD 110 senses ECAPs from the target tissue of patient 102,e.g., with electrodes on one or more leads 108 and associated sensingcircuitry. In some examples, IMD 110 receives a signal indicative of theECAP from one or more sensors, e.g., one or more electrodes andcircuitry, internal or external to patient 102. Such an example signalmay include a signal indicating an ECAP of the tissue of the patient102. Examples of the one or more sensors include one or more sensors canmeasure a compound action potential of the patient 102, or aphysiological effect indicative of a compound action potential. Forexample, to measure a physiological effect of a compound actionpotential, the one or more sensors may be an accelerometer, a pressuresensor, a bending sensor, a sensor can detect a posture of patient 102,or a sensor can detect a respiratory function of patient 102. However,in other examples, external programmer 104 receives a signal indicatinga compound action potential in the target tissue of patient 102 andtransmits a notification to IMD 110.

In the example of FIG. 1 , IMD 110 described as performing a pluralityof processing and computing functions. However, external programmer 104instead may perform one, several, or all of these functions. In thisalternative example, IMD 110 functions to relay sensed signals toexternal programmer 104 for analysis, and external programmer 104transmits instructions to IMD 110 to adjust the one or more parametersdefining the electrical stimulation signal based on analysis of thesensed signals. For example, IMD 110 may relay the sensed signalindicative of an ECAP to external programmer 104. External programmer104 may compare the parameter value of the ECAP to the target ECAPcharacteristic value, and in response to the comparison, externalprogrammer 104 may instruct IMD 110 to adjust one or more parametersthat define the electrical stimulation signal.

In the example techniques described herein, the stimulation parametervalues, growth curves, posture states, and the target ECAPcharacteristic values (e.g., values of the ECAP indicative of targetstimulation intensity) may be initially set at the clinic but may be setand/or adjusted at home by patient 102. Once the target ECAPcharacteristic values are set, the example techniques allow forautomatic adjustment of stimulation parameters to maintain consistentvolume of neural activation and consistent perception of therapy for thepatient when the electrode-to-neuron distance changes. The ability tochange the stimulation parameter values may also allow the therapy tohave long term efficacy, with the ability to keep the intensity of thestimulation (e.g., as indicated by the ECAP) consistent by comparing themeasured ECAP values to the target ECAP characteristic value. IMD 110may perform these changes without intervention by a physician or patient102.

In some examples, the system may change the target ECAP characteristicvalue over a period of time (e.g., based on a sensed posture state orchange in patient conditions). The system may be programmed to changethe target ECAP characteristic in order to adjust the intensity of theelectrical stimulation signal to provide varying sensations to thepatient (e.g., increase or decrease the volume of neural activation). Inone example, a system may be programmed to oscillate a target ECAPcharacteristic value between a maximum target ECAP characteristic valueand a minimum target ECAP characteristic value at a predeterminedfrequency to provide a sensation to the patient that may be perceived asa wave or other sensation that may provide therapeutic relief for thepatient. The maximum target ECAP characteristic value, the minimumtarget ECAP characteristic value, and the predetermined frequency may bestored in the memory of IMD 110 and may be updated in response to asignal from external programmer 104 (e.g., a user request to change thevalues stored in the memory of IMD 110). In other examples, the targetECAP characteristic value may be programmed to steadily increase orsteadily decrease to a baseline target ECAP characteristic value over aperiod of time. In other examples, external programmer 104 may programthe target ECAP characteristic value to automatically change over timeaccording to other predetermined functions or patterns. In other words,the target ECAP characteristic value may be programmed to changeincrementally by a predetermined amount or predetermined percentage, thepredetermined amount or percentage being selected according to apredetermined function (e.g., sinusoid function, ramp function,exponential function, logarithmic function, or the like). Increments inwhich the target ECAP characteristic value is changed may be changed forevery certain number of pulses or a certain unit of time. Although thesystem may change the target ECAP characteristic value, received ECAPsignals may still be used by the system to adjust one or more parametervalues of the electrical stimulation signal in order to meet the targetECAP characteristic value.

In some examples, IMD 110 may not be able to measure ECAPs fromstimulation that has certain pulse widths and/or pulse frequencies. Forexample, longer pulse widths and higher pulse frequencies may result ina delivered stimulation pulse overlapping with an ECAP. Since the ECAPamplitude can be much lower amplitude than the stimulation pulse, thestimulation pulse can cover up any ECAP characteristic value of thesignal. However, IMD 110 may use measured ECAPs at short pulse widthsand/or lower pulse frequencies to identify a combination of stimulationparameter values that produce an ECAP characteristic value (e.g.,intensity) that is representative of effective therapy. IMD 110 may thenselect longer pulse widths and/or higher pulse frequencies according tothe relationship between the pulse width and pulse frequency that areestimated to produce a similar ECAP characteristic value that resultedin the effective therapy.

Although in one example IMD 110 takes the form of an SCS device, inother examples, IMD 110 takes the form of any combination of deep brainstimulation (DBS) devices, implantable cardioverter defibrillators(ICDs), pacemakers, cardiac resynchronization therapy devices (CRT-Ds),left ventricular assist devices (LVADs), implantable sensors, orthopedicdevices, or drug pumps, as examples.

FIG. 2 is a block diagram of IMD 200. IMD 200 may be an example of IMD110 of FIG. 1 . In the example shown in FIG. 2 , IMD 200 includes switchcircuitry 202, stimulation generation circuitry 204, sensing circuitry206, processing circuitry 208, sensor 210, telemetry circuitry 212,power source 214, and memory 216. Each of these circuits may be orinclude programmable or fixed function circuitry can perform thefunctions attributed to respective circuitry. For example, processingcircuitry 208 may include fixed-function or programmable circuitry,stimulation generation circuitry 204 may include circuitry can generateelectrical stimulation signals such as pulses or continuous waveforms onone or more channels, sensing circuitry 206 may include sensingcircuitry for sensing signals, and telemetry circuitry 212 may includetelemetry circuitry for transmission and reception of signals. Memory216 may store computer-readable instructions that, when executed byprocessing circuitry 208, cause IMD 200 to perform various functionsdescribed herein. Memory 216 may be a storage device or othernon-transitory medium.

In the example shown in FIG. 2 , memory 216 stores patient posture statedata 218, which may include one or more patient postures, an activitylevel, or a combination of patient posture and activity level. A set ofpre-established posture state definitions for a patient may be stored inpatient posture state data 218. A posture state definition may bemodified based on user therapy adjustments and/or posture stateinformation. In some cases, the posture state may be expanded and split,or instead, may be reduced in size based on posture state information.The posture state definitions can be automatically updated or updated bya patient, including creating new posture states. Posture states mayinclude, for example, a supine posture, a prone posture, a lying leftand/or lying right, a sitting posture, a reclining posture, a standingposture, and/or activities such as running or riding in an automobile.

Memory 216 may store stimulation parameter settings 220 within memory216 or separate areas within memory 216. Each stored stimulationparameter setting 220 defines values for a set of electrical stimulationparameters (e.g., a stimulation parameter set or therapy program), suchas pulse amplitude, pulse width, pulse frequency, electrode combination,pulse burst rate, pulse burst duration, and/or waveform shape.Stimulation parameter settings 220 may also include additionalinformation such as instructions regarding delivery of electricalstimulation signals based on stimulation parameter relationship data,which can include relationships between two or more stimulationparameters based upon data from electrical stimulation signals deliveredto patient 102 or data transmitted from external programmer 104. Thestimulation parameter relationship data may include measurable aspectsassociated with stimulation, such as an ECAP characteristic value.Stimulation parameter settings 220 may also include target ECAPcharacteristics and/or threshold ECAP characteristic values determinedfor the patient and/or a history of measured ECAP characteristic valuesfor the patient.

Memory 216 also stores patient calibration instructions characteristics222 which may include instructions on calibrating growth curves, such asdefining stimulation pulse sweeps in order to generate the relationshipsbetween ECAP characteristic values and one or more stimulationparameters. Memory 216 may also store growth curve data 224 in separateareas from or as part of patient stimulation parameter settings. Insteadof, or in addition to growth curve data 224, memory 216 may include gainvalues that processing circuitry 208 may use to modulate stimulationpulses as described herein. In other examples, growth curve data 224 mayinclude information regarding relationships between ECAP characteristicsand stimulation parameters for one or more posture states.

Accordingly, in some examples, stimulation generation circuitry 204generates electrical stimulation signals (e.g., pulses) in accordancewith the electrical stimulation parameters noted above. Other ranges ofstimulation parameter values may also be useful and may depend on thetarget stimulation site within patient 102. While stimulation pulses aredescribed, stimulation signals may be of any form, such ascontinuous-time signals (e.g., sine waves) or the like. Switch circuitry202 may include one or more switch arrays, one or more multiplexers, oneor more switches (e.g., a switch matrix or other collection ofswitches), or other electrical circuitry configured to directstimulation signals from stimulation generation circuitry 204 to one ormore of electrodes 232, 234, or directed sensed signals from one or moreof electrodes 232, 234 to sensing circuitry 206. In other examples,stimulation generation circuitry 204 and/or sensing circuitry 206 mayinclude sensing circuitry to direct signals to and/or from one or moreof electrodes 232, 234, which may or may not also include switchcircuitry 202.

Sensing circuitry 206 may be configured to monitor signals from anycombination of electrodes 232, 234. In some examples, sensing circuitry206 includes one or more amplifiers, filters, and analog-to-digitalconverters. Sensing circuitry 206 may be used to sense physiologicalsignals, such as ECAPs. In some examples, sensing circuitry 206 detectsECAPs from a particular combination of electrodes 232, 234. In somecases, the particular combination of electrodes for sensing ECAPsincludes different electrodes than a set of electrodes 232, 234 used todeliver stimulation pulses. Alternatively, in other cases, theparticular combination of electrodes used for sensing ECAPs includes atleast one of the same electrodes as a set of electrodes used to deliverstimulation pulses to patient 102. Sensing circuitry 206 may providesignals to an analog-to-digital converter, for conversion into a digitalsignal for processing, analysis, storage, or output by processingcircuitry 208.

Processing circuitry 208 may include any one or more of amicroprocessor, a controller, a digital signal processor (DSP), anapplication specific integrated circuit (ASIC), a field-programmablegate array (FPGA), discrete logic circuitry, or any other processingcircuitry can provide the functions attributed to processing circuitry208 herein may be embodied as firmware, hardware, software or anycombination thereof. Processing circuitry 208 controls stimulationgeneration circuitry 204 to generate electrical stimulation signalsaccording to stimulation parameter settings 220 stored in memory 216 toapply stimulation parameter values, such as pulse amplitude, pulsewidth, pulse frequency, and waveform shape of each of the electricalstimulation signals.

In the example shown in FIG. 2 , the set of electrodes 232 includeselectrodes 232A, 232B, 232C, and 232D, and the set of electrodes 234includes electrodes 234A, 234B, 234C, and 234D. In other examples, asingle lead may include all eight electrodes 232 and 234 along a singleaxial length of the lead. Processing circuitry 208 also controlsstimulation generation circuitry 204 to generate and apply theelectrical stimulation signals to selected combinations of electrodes232, 234. In some examples, stimulation generation circuitry 204includes a switch circuit (instead of, or in addition to, switchcircuitry 202) that may couple stimulation signals to selectedconductors within leads 230, which, in turn, deliver the stimulationsignals across selected electrodes 232, 234. Such a switch circuit maybe a switch array, switch matrix, multiplexer, or any other type ofswitch circuitry can selectively couple stimulation energy to selectedelectrodes 232, 234 and to selectively sense bioelectrical neuralsignals of a spinal cord of the patient (not shown in FIG. 2 ) withselected electrodes 232, 234.

In other examples, however, stimulation generation circuitry 204 doesnot include a switch circuit and switch circuitry 202 does not interfacebetween stimulation generation circuitry 204 and electrodes 232, 234. Inthese examples, stimulation generation circuitry 204 comprises aplurality of pairs of voltage sources, current sources, voltage sinks,or current sinks connected to each of electrodes 232, 234 such that eachpair of electrodes has a unique signal circuit. In other words, in theseexamples, each of electrodes 232, 234 is independently controlled viaits own signal circuit (e.g., via a combination of a regulated voltagesource and sink or regulated current source and sink), as opposed toswitching signals between electrodes 232, 234.

Electrodes 232, 234 on respective leads 230 may be constructed of avariety of different designs. For example, one or both of leads 230 mayinclude one or more electrodes at each longitudinal location along thelength of the lead, such as one electrode at different perimeterlocations around the perimeter of the lead at each of the locations A,B, C, and D. In one example, the electrodes may be electrically coupledto stimulation generation circuitry 204, e.g., via switch circuitry 202and/or switch circuitry of the stimulation generation circuitry 204, viarespective wires that are straight or coiled within the housing of thelead and run to a connector at the proximal end of the lead. In anotherexample, each of the electrodes of the lead may be electrodes depositedon a thin film. The thin film may include an electrically conductivetrace for each electrode that runs the length of the thin film to aproximal end connector. The thin film may then be wrapped (e.g., ahelical wrap) around an internal member to form the lead 230. These andother constructions may be used to create a lead with a complexelectrode geometry.

Although sensing circuitry 206 is incorporated into a common housingwith stimulation generation circuitry 204 and processing circuitry 208in FIG. 2 , in other examples, sensing circuitry 206 may be in aseparate housing from IMD 200 and may communicate with processingcircuitry 208 via wired or wireless communication techniques.

In some examples, one or more of electrodes 232 and 234 may be suitablefor sensing ECAPs. For instance, electrodes 232 and 234 may sense thevoltage amplitude of a portion of the ECAP signals, where the sensedvoltage amplitude is a characteristic the ECAP signal.

Memory 216 may be configured to store information within IMD 200 duringoperation. Memory 216 may include a computer-readable storage medium orcomputer-readable storage device. In some examples, memory 216 includesone or more of a short-term memory or a long-term memory. Memory 216 mayinclude, for example, random access memories (RAM), dynamic randomaccess memories (DRAM), static random access memories (SRAM), magneticdiscs, optical discs, flash memories, or forms of electricallyprogrammable memories (EPROM) or electrically erasable and programmablememories (EEPROM). In some examples, memory 216 is used to store dataindicative of instructions for execution by processing circuitry 208. Asdiscussed herein, memory 216 can store patient posture state data 218,stimulation parameter settings 220, calibration instructions 222, andgrowth curve data 224.

Sensor 210 may include one or more sensing elements that sense values ofa respective patient parameter. As described, electrodes 232 and 234 maybe the electrodes that sense, via sensing circuitry 206, a value of theECAP indicative of a target stimulation intensity at least partiallycaused by a set of stimulation parameter values. Sensor 210 may includeone or more accelerometers, optical sensors, chemical sensors,temperature sensors, pressure sensors, or any other types of sensors.Sensor 210 may output patient parameter values that may be used asfeedback to control delivery of electrical stimulation signals. IMD 200may include additional sensors within the housing of IMD 200 and/orcoupled via one of leads 108 or other leads. In addition, IMD 200 mayreceive sensor signals wirelessly from remote sensors via telemetrycircuitry 212, for example. In some examples, one or more of theseremote sensors may be external to patient (e.g., carried on the externalsurface of the skin, attached to clothing, or otherwise positionedexternal to the patient). In some examples, signals from sensor 210 mayindicate a posture state (e.g., sleeping, awake, sitting, standing, orthe like), and processing circuitry 208 may select target and/orthreshold ECAP characteristic values according to the indicated posturestate. In this manner, processing circuitry 208 may be configured todetermine the currently occupied posture state of patient 102.

Telemetry circuitry 212 supports wireless communication between IMD 200and an external programmer (not shown in FIG. 2 ) or another computingdevice under the control of processing circuitry 208. Processingcircuitry 208 of IMD 200 may receive, as updates to programs, values forvarious stimulation parameters such as amplitude and electrodecombination, from the external programmer via telemetry circuitry 212.Updates to stimulation parameter settings 220 and input efficacythreshold settings 226 may be stored within memory 216. Telemetrycircuitry 212 in IMB 200, as well as telemetry circuits in other devicesand systems described herein, such as the external programmer, mayaccomplish communication by radiofrequency (RF) communicationtechniques. In addition, telemetry circuitry 212 may communicate with anexternal medical device programmer (not shown in FIG. 2 ) via proximalinductive interaction of IMD 200 with the external programmer. Theexternal programmer may be one example of external programmer 104 ofFIG. 1 . Accordingly, telemetry circuitry 212 may send information tothe external programmer on a continuous basis, at periodic intervals, orupon request from IMD 110 or the external programmer.

Power source 214 delivers operating power to various components of IMD200. Power source 214 may include a rechargeable or non-rechargeablebattery and a power generation circuit to produce the operating power.Recharging may be accomplished through proximal inductive interactionbetween an external charger and an inductive charging coil within IMD200. In other examples, traditional primary cell batteries may be used.In some examples, processing circuitry 208 may monitor the remainingcharge (e.g., voltage) of power source 214 and select stimulationparameter values that may deliver similarly effective therapy at lowerpower consumption levels when needed to extend the operating time ofpower source 214. For example, power source 214 may switch to a lowerpulse frequency based on the relationships of parameters that mayprovide similar ECAP characteristic values.

According to the techniques of the disclosure, stimulation generationcircuitry 204 of IMB 200 receives, via telemetry circuitry 212,instructions to deliver electrical stimulation according to stimulationparameter settings 220 to a target tissue site of the spinal cord of thepatient via a plurality of electrode combinations of electrodes 232, 234of leads 230 and/or a housing of IMD 200. Each electrical stimulationsignal may elicit an ECAP that is sensed by sensing circuitry 206 viaelectrodes 232 and 234. Processing circuitry 208 may receive, via anelectrical signal sensed by sensing circuitry 206, informationindicative of an ECAP signal (e.g., a numerical value indicating acharacteristic of the ECAP in electrical units such as voltage or power)produced in response to the electrical stimulation signal(s).Stimulation parameter settings 220 may be updated according to the ECAPsrecorded at sensing circuitry 206 according to the following techniques.

In one example, the plurality of pulses each have a pulse width ofgreater than approximately 300 μs and less than approximately 2000 μs(i.e., 2 milliseconds). In some examples, the pulse width is greaterthan approximately 300 μs and less than approximately 900 μs. In anotherexample, the pulse width is greater than approximately 300 μs and lessthan approximately 500 μs. However, in other examples, pulses may have apulse width less than 300 μs. In one example, the pulses have a pulsewidth of approximately 450 μs and a pulse frequency of approximately 60Hertz. Amplitude (current and/or voltage) for the pulses may be betweenapproximately 0.5 mA (or volts) and approximately 10 mA (or volts),although amplitude may be lower or greater in other examples.

In one example, the predetermined pulse frequency of the plurality ofpulses may be less than approximately 400 Hertz. In some examples, thepredetermined pulse frequency of the plurality of pulses may be betweenapproximately 50 Hertz and 70 Hertz. In one example, the predeterminedpulse frequency of the plurality of pulses may be approximately 60Hertz. However, the pulses may have frequencies greater than 400 Hertzor less than 50 Hertz in other examples. In addition, the pulses may bedelivered in bursts of pulses, with interburst frequencies of the pulsesbeing low enough such that a sensed ECAP can still fit within the windowbetween consecutive pulses delivered within the burst of pulses. In anyexample, processing circuity 208 may be configured to detect ECAPselicited from respective stimulation pulses.

Processing circuitry 208 may be configured to compare one or morecharacteristics of ECAPs sensed by sensing circuitry 206 with targetECAP characteristics stored in memory 216 (e.g., patient ECAPcharacteristics 222). For example, processing circuitry 208 candetermine the amplitude of each ECAP signal received at sensingcircuitry 206, and processing circuitry 208 can determine therepresentative amplitude of at least one respective ECAP signal andcompare the representative amplitude of a series of ECAP signals to atarget ECAP.

In other examples, processing circuitry 208 may use the representativeamplitude of the at least one respective ECAP to change other parametersof stimulation pulses to be delivered, such as pulse width, pulsefrequency, and pulse shape. All of these parameters may contribute tothe intensity of the stimulation pulses, and changing one or more ofthese parameter values may effectively adjust the stimulation pulseintensity to compensate for the changed distance between the stimulationelectrodes and the nerves indicated by the characteristic (e.g., arepresentative amplitude) of the ECAP signals.

In some examples, leads 230 may be linear 8-electrode leads (notpictured); sensing and stimulation delivery may each be performed usinga different set of electrodes. In a linear 8-electrode lead, eachelectrode may be numbered consecutively from 0 through 7. For instance,a pulse may be generated using electrode 1 as a cathode and electrodes 0and 2 as anodes (e.g., a guarded cathode), and a respective ECAP signalmay be sensed using electrodes 6 and 7, which are located on theopposite end of the electrode array. This strategy may minimize theinterference of the stimulation pulse with the sensing of the respectiveECAP. Other electrode combinations may be implemented, and the electrodecombinations may be changed using the patient programmer via telemetrycircuitry 212. For example, stimulation electrodes and sensingelectrodes may be positioned closer together. Shorter pulse widths forthe nontherapeutic pulses may allow the sensing electrodes to be closerto the stimulation electrodes.

In one example, sensor 210 may detect a change in posture state,including activity or a change in posture of the patient. Processingcircuitry 208 may receive an indication from sensor 210 that theactivity level or posture of the patient is changed, and processingcircuitry 208 can initiate or change the delivery of the plurality ofpulses according to stimulation parameter settings 220. For example,processing circuitry 208 may increase the frequency of pulse deliveryand respective ECAP sensing in response to receiving an indication thatthe patient activity has increased, which may indicate that the distancebetween electrodes and nerves will likely change. Alternatively,processing circuitry 208 may decrease the frequency of pulse deliveryand respective ECAP sensing in response to receiving an indication thatthe patient activity has decreased. In some examples, one or moretherapy parameters (e.g., frequency, amplitude, slew rate, pulse width,or the like) may be adjusted (e.g., increased or decreased) in responseto receiving an indication that the patient posture state has changed.Processing circuitry 208 can update patient posture state data 218 andgrowth curve data 224 according to the signal received from sensor 210.

FIG. 3 is a block diagram of the example external programmer 300.External programmer 300 may be an example of external programmer 104 ofFIG. 1 . Although programmer 300 may generally be described as ahand-held device, external programmer 300 may be a larger portabledevice or a more stationary device. In addition, in some examples,external programmer 300 may be included as part of an external chargingdevice or include the functionality of an external charging device. Asillustrated in FIG. 3 , external programmer 300 may include a processingcircuitry 302, memory 304, user interface 306, telemetry circuitry 308,and power source 310. Storage device 304 may store instructions that,when executed by processing circuitry 302, cause processing circuitry302 and external programmer 300 to provide the functionality ascribed toexternal programmer 300 throughout this disclosure. Each of thesecomponents, circuitry, or modules, may include electrical circuitry thatcan perform some, or all of the functionality described herein. Forexample, processing circuitry 302 may include processing circuitry toperform the processes discussed with respect to processing circuitry302.

In general, programmer 300 comprises any suitable arrangement ofhardware, alone or in combination with software and/or firmware, toperform the techniques attributed to programmer 300, and processingcircuitry 302, user interface 306, and telemetry circuitry 308 ofprogrammer 300. In various examples, programmer 300 may include one ormore processors, such as one or more microprocessors, DSPs, ASICs,FPGAs, or any other equivalent integrated or discrete logic circuitry,as well as any combinations of such components. Programmer 300 also, invarious examples, may include a memory 304, such as RAM, ROM, PROM,EPROM, EEPROM, flash memory, a hard disk, a CD-ROM, comprisingexecutable instructions for causing the one or more processors toperform the actions attributed to them. Moreover, although processingcircuitry 302 and telemetry circuitry 308 are described as separate, insome examples, processing circuitry 302 and telemetry circuitry 308 arefunctionally integrated. In some examples, processing circuitry 302 andtelemetry circuitry 308 correspond to individual hardware units, such asASICs, DSPs, FPGAs, or other hardware units.

Memory 304 (e.g., a storage device) may store instructions that, whenexecuted by processing circuitry 302, cause processing circuitry 302 andprogrammer 300 to provide the functionality ascribed to programmer 300throughout this disclosure. For example, memory 304 may includeinstructions that cause processing circuitry 302 to obtain a stimulationparameter setting from memory, select a spatial electrode movementpattern, or receive a user input and send a corresponding command toprogrammer 300, or instructions for any other functionality. Inaddition, memory 304 may include a plurality of stimulation parametersettings, where each setting includes a parameter set that defineselectrical stimulation. Memory 304 may also store data received from amedical device (e.g., IMD 110). For example, memory 304 may store ECAPrelated data recorded at a sensing circuitry of the medical device, andmemory 304 may also store data from one or more sensors of the medicaldevice.

User interface 306 may include a button or keypad, lights, a speaker forvoice commands, a display, such as a liquid crystal (LCD),light-emitting diode (LED), or organic light-emitting diode (OLED). Insome examples the display may be a touch screen. User interface 306 candisplay any information related to the delivery of electricalstimulation, identified patient behaviors, sensed patient parametervalues, patient behavior criteria, or any other such information.External programmer 300 may receive user input (e.g., indication of whenthe patient changes posture states) via user interface 306. The inputmay be, for example, in the form of pressing a button on a keypad orselecting an icon from a touch screen. The input may request starting orstopping electrical stimulation, the input may request a new spatialelectrode movement pattern or a change to an existing spatial electrodemovement pattern, of the input may request some other change to thedelivery of electrical stimulation. In other examples, user interface306 may receive input from the patient and/or clinician regardingefficacy of the therapy, such as binary feedback, numerical ratings,textual input, etc. In some examples, processing circuitry 302 mayinterpret patient requests to change therapy as negative feedbackregarding the current parameter values used to define therapy.

Telemetry circuitry 308 may support wireless communication between themedical device and programmer 300 under the control of processingcircuitry 302. Telemetry circuitry 308 can communicate with anothercomputing device via wireless communication techniques, or directcommunication through a wired connection. In some examples, telemetrycircuitry 308 provides wireless communication via an RF or proximalinductive medium. In some examples, telemetry circuitry 308 includes anantenna, which may take on a variety of forms, such as an internal orexternal antenna.

Examples of local wireless communication techniques that may be employedto facilitate communication between programmer 300 and IMD 110 includeRF communication according to the 902.11 or Bluetooth specification setsor other standard or proprietary telemetry protocols. In this manner,other external devices may be capable of communicating with programmer300 without needing to establish a secure wireless connection. Asdescribed herein, telemetry circuitry 308 can transmit a spatialelectrode movement pattern or other stimulation parameter values to IMD110 for delivery of electrical stimulation.

In some examples, selection of stimulation parameter settings may betransmitted to the medical device for delivery to the patient. In otherexamples, stimulation parameter settings may include medication,activities, or other instructions that the patient must performthemselves or a caregiver perform for patient 102. In some examples,external programmer 300 may provide visual, audible, and/or tactilenotifications that indicate there are new instructions. Externalprogrammer 300 may require receiving user input acknowledging that theinstructions have been completed in some examples.

According to the techniques of the disclosure, user interface 306 ofexternal programmer 300 receives an indication from a clinicianinstructing a processor of the medical device to update one or morepatient posture state settings, gain values, growth curve settings, orstimulation parameter settings. Updating the posture state settings,gain values, growth curve settings may cause the stimulation parametersettings to update as well, including changing one or more parametervalues of the electrical stimulation signal delivered by the medicaldevice according to the settings, such as pulse amplitude, pulse width,pulse frequency, electrode combination, and/or waveform shape. Gainvalues and/or growth curve settings may be based upon sensed ECAPsignals, posture state data, and stimulation parameter data, in someexamples. User interface 306 may also receive instructions from theclinician commanding any electrical stimulation.

Power source 310 can deliver operating power to various components ofprogrammer 300. Power source 310 may be the same as or substantiallysimilar to power source 214. Power source 310 may include a battery anda power generation circuit to produce the operating power. In someexamples, the battery is rechargeable to allow extended operation.Recharging may be accomplished by electrically coupling power source 310to a cradle or plug that is connected to an alternating current (AC)outlet. In addition, recharging may be accomplished through proximalinductive interaction between an external charger and an inductivecharging coil within external programmer 300. In other examples,traditional batteries (e.g., nickel cadmium or lithium ion batteries)may be used. In addition, external programmer 300 may be directlycoupled to an alternating current outlet to operate.

The architecture of external programmer 300 illustrated in FIG. 3 isshown as an example. The techniques as set forth in this disclosure maybe implemented in the example external programmer 300 of FIG. 3 , aswell as other types of systems not described specifically herein.Nothing in this disclosure should be construed so as to limit thetechniques of this disclosure to the example architecture illustrated byFIG. 3 .

FIG. 4 is a graph 400 of an example ECAP signals sensed for respectiveelectrical stimulation pulses. As shown in FIG. 3 , graph 400 showsexample ECAP signal 402 (dotted line) and ECAP signal 404 (solid line).Each of ECAP signals 402 and 404 may be sensed from pulses that weredelivered from a guarded cathode and bi-phasic pulses including aninterphase interval between each positive and negative phase of thepulse. The guarded cathode of the stimulation electrodes is located atthe end of an 8-electrode lead while two sensing electrodes are providedat the other end of the 8-electrode lead. ECAP signal 402 illustratesthe voltage amplitude sensed as a result from a sub-thresholdstimulation pulse. Peaks 406 of ECAP signal 402 are detected andrepresent the artifact of the delivered pulse. However, no propagatingsignal is detected after the artifact in ECAP signal 404 because thepulse was sub-threshold.

In contrast to ECAP signal 402, ECAP signal 404 represents the voltageamplitude detected from a supra-threshold stimulation pulse. Peaks 406of ECAP signal 404 are detected and represent the artifact of thedelivered pulse. After peaks 406, ECAP signal 404 also includes peaksP1, N1, and P2, which are three peaks representative of propagatingaction potentials from an ECAP. The example duration of the artifact andpeaks P1, N1, and P2 is approximately 1 millisecond (ms). When detectingthe ECAP of ECAP signal 404, different characteristics may beidentified. For example, the characteristic of the ECAP may be theamplitude between N1 and P2. This N1-P2 amplitude can be detected evenif the artifact impinges on P1, a relatively large signal, and the N1-P2amplitude may be minimally affected by electronic drift in the signal.In other examples, the characteristic of the ECAP used to control pulsesmay be an amplitude of P1, N1, or P2 with respect to neutral or zerovoltage. In some examples, the characteristic of the ECAP used tocontrol pulses may be a sum of two or more of peaks P1, N1, or P2. Inother examples, the characteristic of ECAP signal 404 may be the areaunder one or more of peaks P1, N1, and/or P2. In other examples, thecharacteristic of the ECAP may be a ratio of one of peaks P1, N1, or P2to another one of the peaks. In some examples, the characteristic of theECAP may be a slope between two points in the ECAP signal, such as theslope between N1 and P2. In other examples, the characteristic of theECAP may be the time between two points of the ECAP, such as the timebetween N1 and P2. The time between two points in the ECAP signal may bereferred to as a latency of the ECAP and may indicate the types offibers being captured by the pulse. ECAP signals with lower latency(i.e., smaller latency values) indicate a higher percentage of nervefibers that have faster propagation of signals, whereas ECAP signalswith higher latency (i.e., larger latency values) indicate a higherpercentage of nerve fibers that have slower propagation of signals.Other characteristics of the ECAP signal may be used in other examples.

The amplitude of the ECAP signal increases with increased amplitude ofthe pulse, as long as the pulse amplitude is greater than the thresholdsuch that nerves depolarize and propagate the signal. The target ECAPcharacteristic (e.g., the target ECAP amplitude) may be determined fromthe ECAP signal detected from a pulse when pulses are determined todeliver effective therapy to the patient. The ECAP signal thus isrepresentative of the distance between the stimulation electrodes andthe nerves appropriate for the stimulation parameter values of thepulses delivered at that time. Therefore, IMD 110 may attempt to usedetected changes to the measured ECAP characteristic value to changestimulation pulse parameter values and maintain the target ECAPcharacteristic value during stimulation pulse delivery. Alternatively,IMD 110 may attempt to prevent undesirable stimulation intensity bydecreasing stimulation pulse intensity in response to the ECAPcharacteristic value exceeding a threshold ECAP characteristic value.

FIG. 5 is a timing diagram 500 illustrating one example of electricalstimulation pulses and respective sensed ECAPs, in accordance with oneor more techniques of this disclosure. For convenience, FIG. 5 isdescribed with reference to IMD 200 of FIG. 2 . As illustrated, timingdiagram 500 includes first channel 502, a plurality of control pulses504A-504N (collectively “control pulses 504”), second channel 506, aplurality of respective ECAPs 508A-508N (collectively “ECAPs 508”), anda plurality of stimulation interference signals 509A-509N (collectively“stimulation interference signals 509”). In the example of FIG. 5 ,stimulation pulses 504 may or may not contribute to therapy for thepatient. In any case, stimulation pulses 504 may elicit respective ECAPs508 for the purpose of determining relative neural recruitment due tothe stimulation pulses 504, which may be reflective as a growth curvespecific to the posture state of the patient that was assumed with theECAPs 508 were sensed.

First channel 502 is a time/voltage (and/or current) graph indicatingthe voltage (or current) of at least one electrode of electrodes 232,234. In one example, the stimulation electrodes of first channel 502 maybe located on the opposite side of the lead as the sensing electrodes ofsecond channel 506. Stimulation pulses 504 may be electrical pulsesdelivered to the spinal cord of the patient by at least one ofelectrodes 232, 234, and stimulation pulses 504 may be balanced biphasicsquare pulses with an interphase interval. In other words, each ofcontrol pulses 504 are shown with a negative phase and a positive phaseseparated by an interphase interval. For example, a control pulse 504may have a negative voltage for the same amount of time and amplitudethat it has a positive voltage. It is noted that the negative voltagephase may be before or after the positive voltage phase. Stimulationpulses 504 may be delivered according to instructions stored in storagedevice 212 of IMD 200.

In some examples, each of stimulation pulses 504 may be a part of asweep of pulses configured to determine a relationship between thestimulation parameter values of the pulses and a characteristic value ofthe resulting respective ECAPs 508. For example, the relationship may bea growth curve of ECAP voltage amplitude versus pulse current amplitude.In this manner, each of stimulation pulses 504 may differ from eachother by a parameter value, such as an iteratively increasing currentamplitude. In some examples, the sweep may also include iterativelydecreasing current amplitude, or a separate sweep of iterativelydecreasing current amplitude may be performed. Separate growth curvesmay be generated from the respective increasing and decreasing currentamplitudes. In some examples, such sweeps may be performed for eachposture state of a plurality of posture states in order to determine thegrowth curves, gain values, or some characteristic related to ECAPs forthat posture state. In one example, stimulation pulses 504 may have apulse width of less than approximately 300 microseconds (e.g., the totaltime of the positive phase, the negative phase, and the interphaseinterval is less than 300 microseconds). In another example, controlpulses 504 may have a pulse width of approximately 100 microseconds foreach phase of the bi-phasic pulse. In some examples, the pulse width ofstimulation pulses 504 may be longer than 300 microseconds, as long asthe pulse width does not interfere with the detection of the desired oneor more features of the elicited ECAPs 508. As illustrated in FIG. 5 ,stimulation pulses 504 may be delivered via channel 502. Delivery ofstimulation pulses 504 may be delivered by leads 230 in a guardedcathode electrode combination. For example, if leads 230 are linear8-electrode leads, a guarded cathode combination is a central cathodicelectrode with anodic electrodes immediately adjacent to the cathodicelectrode.

Second channel 506 is a time/voltage (and/or current) graph indicatingthe voltage (or current) of at least one electrode of electrodes 232,234. In one example, the electrodes of second channel 506 may be locatedon the opposite side of the lead as the electrodes of first channel 502.ECAPs 508 may be sensed at electrodes 232, 234 from the spinal cord ofthe patient in response to stimulation pulses 504. ECAPs 508 areelectrical signals which may propagate along a nerve away from theorigination of stimulation pulses 504. In one example, ECAPs 508 aresensed by different electrodes than the electrodes used to deliverstimulation pulses 504. As illustrated in FIG. 5 , ECAPs 508 may berecorded on second channel 506. In some examples, ECAPs 508 may not besensed after each stimulation pulse 504.

Stimulation interference signals 509A, 509B, and 509N (e.g., theartifact of the stimulation pulses) may be sensed by leads 230 and maybe sensed during the same period of time as the delivery of stimulationpulses 504. Since the interference signals may have a greater amplitudeand intensity than ECAPs 508, any ECAPs arriving at IMD 200 during theoccurrence of stimulation interference signals 509 may not be adequatelysensed by sensing circuitry 206 of IMD 200. However, ECAPs 508 may besufficiently sensed by sensing circuitry 206 because each ECAP 508, orat least a portion of ECAP 508 that includes one or more desiredfeatures of ECAP 508 that is used to detect the posture state and/or asfeedback for stimulation pulses 504, falls after the completion of eacha stimulation pulse 504. As illustrated in FIG. 5 , stimulationinterference signals 509 and ECAPs 508 may be recorded on channel 506.

In some examples, IMD 200, for example, may deliver the entire group ofstimulation pulses 504 (e.g., a sweep) consecutively and without anyother intervening pulses in order to detect ECAPs 508 from whichrespective characteristic values are determined. IMD 200 may thendetermine the relationship between the characteristic values from ECAPs508 and the different parameter values of stimulation pulses 504. In oneexample, the sweep of pulses 504 may be delivered by IMD 200 during abreak in delivery of other types of stimulation pulses.

FIG. 6 is a graph 600 of example growth curves 604A, 604B, 606A, 606B,608A, and 608B of sensed ECAPs from respective stimulation pulseamplitudes at respective posture states. Growth curves 604A and 604B(collectively “growth curves 604”) may be associated with one posturestate, growth curves 606A and 606B (collectively “growth curves 606”)may be associated with a second posture state, and growth curves 608Aand 608B (collectively “growth curves 608”) may be associated with athird posture state Graph 600 illustrates example ECAPs shown as dots(growth curves 604), squares (growth curves 606), and triangles (growthcurves 608) for respective different current amplitudes of stimulationpulses. ECAPs will sometimes not be generated until the stimulationpulse amplitude reaches a threshold, approximately at 4.5 mA current inthe example of FIG. 6 . Then, as the current amplitude is increased, theECAP amplitude also increases approximately linearly. This linearrelationship is shown by growth curves 604, 606, 608. Besides growthcurves varying based on the posture state of the patient, the slope mayvary for each patient based on the type of electrodes implanted, wherethe electrodes are implanted, the sensitivity of the patient's neuronsto stimulation, neurological dysfunction, or other factors. In addition,as discussed herein, the growth curves may vary according to whether thestimulation parameter for consecutive pulses was iteratively increasedor iteratively decreased. The result is different growth curves for thesame posture state, such as growth curves 604A and 604B.

While a patient is in a given posture state, sensed ECAPs may bedetected for stimulation pulses with different current amplitudes. Forexample, each of growth curves 602, 604, and 606 may be for a singleposture state, e.g., supine, prone, sitting, standing, or lying on theright side or left side. If a patient changes posture states, the growthcurve can also change. When a patient changes posture states, e.g.,supine to standing and standing to running, the corresponding growthcurve can change as well. For example, growth curves 602 may beassociated with a supine posture state, growth curves 604 may beassociated with a sitting posture state, and growth curves 606 may beassociated with a prone posture state. In some examples, a patient maychange posture states, but the same growth curves, or gain values, mayapply to the different posture state.

The slope of the growth curves 602, 604, and 606 that linearly increasemay indicate the relationship between sensed ECAP amplitudes and pulseamplitudes. However, the different growth curves from each pair ofgrowth curves 602, 604, and 606 are generated due to iterativelyincreasing or iteratively decreasing the current amplitude. For example,growth curve 604A may represent the relationship between ECAPcharacteristic values of ECAP voltage amplitude to increasing thecurrent amplitude of consecutive pulses. Conversely, growth curve 604Bmay represent the relationship between ECAP characteristic values ofECAP voltage amplitude to decreasing the current amplitude ofconsecutive pulses. The steeper slope of growth curve 604A when comparedto growth curve 604B indicates that increasing current amplitude betweenpulses causes a faster neural recruitment rate than when decreasingcurrent amplitude between pulses. Therefore, a system may need toincrease current amplitude at a slower rate (e.g., smaller incrementalcurrent amplitude increases) when increasing current amplitude than therate used to decrease current amplitude. In this manner, each of growthcurves 604A, 606A, and 608A may represent relationships between the ECAPcharacteristic value and iteratively increasing current amplitude, andeach of growth curves 604B, 606B, and 608B may represent relationshipsbetween the ECAP characteristic value and iteratively decreasing currentamplitude.

In some examples, the gain value used to increase or decreasestimulation parameter values may be inversely proportional to the slopeof the growth curve of values of the characteristic of ECAP signals(e.g., an amplitude such as the N1-P2 amplitude or the amplitude of anypeak of the ECAP signal) elicited from respective stimulation pulsesdelivered to the patient and at least partially defined by differentvalues of a stimulation parameter (e.g., current amplitude, voltageamplitude, or pulse width). For example, the gain value for a patientmay be used to dynamically adjust pulse amplitude based on the sensedECAP amplitudes. In some examples, the gain may be approximated for apatient based on historical data for similar patients. In otherexamples, the system may generate a custom growth curve and gainspecific to the patient before starting therapy with the system, such asusing the calibration routine including sweeps of different pulsesdescribed herein.

FIG. 7 is a flow diagram illustrating an example technique fordetermining a posture state for a patient and controlling therapy basedon the posture state, in accordance with one or more techniques of thisdisclosure. For convenience, FIG. 7 is described with respect to IMD 200of FIG. 2 . However, the techniques of FIG. 7 may be performed bydifferent components of IMD 200 or by additional or alternative medicaldevices. FIG. 7 will be described using stimulation pulses thateliciting detectable ECAP signals, where the pulses may or may notcontribute to a therapeutic effect for the patient. IMD 200, forexample, may use detected ECAP signals to determine growth curves fromwhich gain values may be used to adjust stimulation parameters. IMD 200may also, or alternatively, determine one or more parameters of a set ofpulses that do not elicit ECAPs, or any combination thereof. Althoughprocessing circuitry 210 will be described as performing much of thetechnique of FIG. 7 , other components of IMD 200 and/or other devicesmay perform some or all of the technique in other examples.

In the example operation of FIG. 7 , processing circuitry 210 controlsstimulation circuitry 202 to calibrate posture state information, suchas determining growth curves for a patient (702). Processing circuitry210 may then determine whether or not growth curves need to bedetermined or calibrated (704). If processing circuitry 210 does nothave instructions to calibrate the growth curves (“NO” branch of block704), processing circuitry 210 may continue to deliver stimulationaccording to posture state and ECAP signals (706). If processingcircuitry 210 does have instructions to determine growth curves (“YES”branch of block 704), processing circuitry 210 controls stimulationcircuitry 202 to deliver the first stimulation pulse as part of a sweepof pulses with different parameter values (708). Processing circuitry210 controls sensing circuitry 206 to detect the ECAP signal elicited bythe stimulation pulse (710). If the sweep is not complete (e.g., thereare more pulses of the sweep to be delivered) (“NO” branch of block712), processing circuitry 210 selects the next stimulation parametervalue (e.g., the next amplitude) for the next stimulation pulse of thesweep (714) and controls stimulation circuitry 202 to deliver the nextstimulation pulse of the sweep (708). A sweep of stimulation pulses mayinclude at least two pulses, four or more pulses, or six or more pulses.In addition, the sweep may only increase the stimulation parametervalue, only decrease the stimulation parameter value, or performiterative increases in the stimulation parameter value and iterativedecreases in the stimulation parameter value. Although more pulses mayenable a more accurate relationship, as few pulses as possible may beused to reduce the amount of time needed to deliver pulses of the sweepand sense the resulting ECAP signals. Processing circuitry 210 maycomplete these sweeps for some or all posture states of the patient.

If the sweep is complete and there are no more stimulation pulses of thesweep to be delivered (“YES” branch of block 712), processing circuitry210 analyzes the detected ECAP signals from the sweep and determines oneor more growth curves for these detected ECAP signals (716). Theanalysis of the detected ECAP signals may include determining at leastone characteristic value for each ECAP signal (e.g., an amplitudebetween the N1-P2 peaks, area under the N1 and/or P2 peaks, or othermeasure) and then associating that characteristic value to at least oneparameter value (e.g., pulse current amplitude) that defined thestimulation pulse that elicited the characteristic value. All of thecharacteristic values and associated parameter values can be plotted,and processing circuitry 210 may determine a best fit line to the pointsand determine the slope of that best fit line for a particular growthcurve. In other examples, processing circuitry 210 may determine arelationship between the ECAP characteristic values and respectiveparameter values that is different than a growth curve. Again,processing circuitry 210 may determine one growth curve for increasingthe stimulation parameter value and another growth curve for decreasingthe stimulation parameter value.

Processing circuitry 210 may then determine gain values for therespective growth curves of increasing and decreasing parameter values(718). The gain value may be inversely proportional to the slope of therespective growth curve. Processing circuitry 210 may store these gainvalues in memory 216. Processing circuitry 210 may then use thedetermined gain values for delivering therapy according to therespective gain values and posture states of the patient (706).Processing circuitry 210 may perform the calibration process of FIG. 7during initial set up and programming of IMD 200 and, in some examples,periodically during therapy as the patient's sensitivity to stimulationpulses may change over time.

FIG. 8 is a diagram illustrating an example technique 800 for adjustingstimulation therapy. As shown in the example of FIG. 8 , the system,such as IMD 200 or any other device or system described herein, maydynamically adjust pulse amplitude (or other parameter) based on thegain value representing the patient sensitivity to stimulation.Processing circuitry 208 of IMD 200 may control stimulation generationcircuitry 204 to deliver a stimulation pulse to a patient. Processingcircuitry 208 may then control sensing circuity 206 to sense an ECAPsignal elicited by the pulse and then identify a characteristic of theECAP signal (e.g., an amplitude of the ECAP signal). Processingcircuitry 208 may then determine, based on the characteristic of theECAP signal, a gain value to use for adjusting a stimulation parametervalue (e.g., an amplitude, pulse width value, pulse frequency value,and/or slew rate value) that at least partially defines the nextstimulation pulse. Processing circuitry 208 may then control stimulationgeneration circuitry 204 to deliver the stimulation pulse according tothe determined stimulation pulse.

As shown in FIG. 8 , a pulse 812 is delivered to the patient viaelectrode combination 814, shown as a guarded cathode of threeelectrodes. The resulting ECAP is sensed by the two electrodes at theopposing end of the lead of electrode combination 816 fed to adifferential amplifier 818. For each sensed ECAP, processing circuitry208 may measure an amplitude of a portion of the ECAP signal, such asthe N1-P2 voltage amplitude from the portion of the ECAP signal.Processing circuitry 208 may average the recently measured ECAPamplitudes, such as averaging the most recent, and consecutive, 2, 3, 4,5, 6, or more ECAP amplitudes. In some examples, the average may be amean or median value. In some examples, one or more ECAP amplitudes maybe ignored from the calculations if the amplitude value is determined tobe an error. The measured amplitude 820 (or average measured amplitude)is then subtracted from the selected target ECAP amplitude 802 togenerate a differential amplitude (e.g., an ECAP differential value).The selected target ECAP amplitude 802 may be determined from an ECAPsensed when the physician or patient initially discovers effectivetherapy from the stimulation pulses. This target ECAP amplitude 802 mayessentially represent a reference distance between the stimulationelectrodes and the target neurons (e.g., the spinal cord for the case ofSCS). The target ECAP amplitude 802 may also represent the target neuralrecruitment for the patient.

The differential amplitude may represent whether the stimulationintensity of the next stimulation pulse should increase or decrease inorder to achieve the target ECAP amplitude 802. For example, a positivedifferential amplitude indicates that the measured amplitude (e.g., thedetermined characteristic value of the last one or more ECAP signals) isless than the target ECAP amplitude 802 and the stimulation intensityneeds to increase in order to increase neural recruitment to achieveneural recruitment closer to the ECAP amplitude 802. Conversely, anegative differential amplitude indicates that the measured amplitude(e.g., the determined characteristic value of the last one or more ECAPsignals) is greater than the target ECAP amplitude 802 and thestimulation intensity needs to decrease in order to decrease neuralrecruitment to achieve neural recruitment closer to the ECAP amplitude802. Therefore, gate 807 determines whether the differential amplitudeis greater than zero (e.g., a positive differential amplitude) or lessthan zero (e.g., a negative differential value), and causes processingcircuitry 208 to determine the appropriate gain value for that positivedifferential amplitude or negative differential amplitude.

The differential amplitude is then multiplied by the appropriate gainvalue for the patient to generate a differential value 808A or 808B.Processing circuitry 208 may detect patient posture state 804 at varyingintervals including, e.g., periodic time intervals, at certain steps ofthe technique 800, in response to one or more trigger events, orcontinuously. For example, processing circuitry 208 may be continuouslydetecting posture state 804 of the patient in order to select anappropriate growth curve 806 for the posture state. As discussed above,each posture state may be associated with respective growth curves forincreasing stimulation intensity or decreasing stimulation intensity. Ifthe differential amplitude is positive, processing circuitry 208 selectsthe gain value associated with increasing stimulation intensity. Theselected gain value for increasing stimulation intensity is thenmultiplied by differential amplitude to calculate the differential value808A. Conversely, if the differential amplitude is negative, processingcircuitry 208 selects the gain value associated with decreasingstimulation intensity. The selected gain value for decreasingstimulation intensity is then multiplied by differential amplitude tocalculate the differential value 808B. In other examples, processingcircuitry 208 may select the gain value directly from the detectedposture state instead of first selecting the associated growth curve. Insome examples, one gain value for increasing stimulation intensity andanother gain value for decreasing stimulation intensity may be used forall posture states. Processing circuitry 208 may add the differentialvalue 808A or 808B to the current pulse amplitude 810 to generate thenew, or adjusted, pulse amplitude that at least partially defines thenext pulse 812.

The following formulas may represent the function used to calculate thepulse amplitude of the next pulse 812. Equation 1 below represents anequation for calculating the new current amplitude using a linearfunction, wherein Ac is the current pulse amplitude, D is thedifferential amplitude by subtracting the measured amplitude from thetarget ECAP amplitude, G is a real number for the gain value, and AN isthe new pulse amplitude:A _(N) =A _(C)+(D×G)   (1)In some examples, the gain value G is a constant for increasingstimulation intensity or decreasing stimulation intensity. In thismanner, the gain value G may not change for a given input. It is notedthat different gain values may be employed for increasing stimulationthan decreasing stimulation, as discussed herein. Alternatively,processing circuitry 208 may calculate the gain value G such that thegain value varies according to one or more inputs or factors. In thismanner, for a given input or set of inputs, processing circuitry 208 maychange the gain value G. Equation 2 below represents an example linearfunction for calculating the gain value, wherein M is a multiplier, D isthe differential amplitude by subtracting the measured amplitude fromthe target ECAP amplitude, and G is the gain value:G=M×D   (2)Processing circuitry 208 may use the gain value G calculated in Equation2 in Equation 1. This would result in Equation 1 being a non-linearfunction for determining the new current amplitude. According toEquation 2 above, the gain value G may be greater for larger differencesbetween the measured amplitude and the target ECAP amplitude. Thus, gainvalue G will cause non-linear changes to the current amplitude. In thismanner, the rate of change in the current amplitude will be higher forlarger differences between the measured amplitude and the target ECAPamplitude and lower for smaller differences between the measuredamplitude and the target ECAP amplitude. In other examples, a non-linearfunction may be used to calculate the gain value G.

The pulse width of the stimulation pulse may be greater thanapproximately 300 μs and less than approximately 1000 μs. In otherexamples, the pulse width of the stimulation pulse may be less thanapproximately 300 μs or greater than 1000 μs. The stimulation pulse maybe a monophasic pulse followed a passive recharge phase. However, inother examples, the pulse may be a bi-phasic pulse that includes apositive phase and a negative phase. In some examples, a pulse may beless than 300 μs, but the following passive recharge phase or even anactive recharge phase (of a bi-phasic pulse) may still obscure thedetectable ECAP signal from that pulse. In other examples, the pulsewidth of the stimulation pulse may be greater than 300 μs, but some ofthe ECAP signal may be obscured by the stimulation pulse.

In some examples, depending upon, at least in part, pulse width of thestimulation pulse, IMD 110 may not sufficiently detect an ECAP signalbecause the stimulation pulse is also detected as an artifact thatobscures the ECAP signal. If ECAPs are not adequately recorded, thenECAPs arriving at IMD 110 cannot be used to determine the efficacy ofstimulation parameter settings, and electrical stimulation signalscannot be altered according to responsive ECAPs. In some examples, pulsewidths may be less than approximately 300 μs, which may increase theamount of each ECAP signal that is detectable. Similarly, high pulsefrequencies may interfere with IMD 110 sufficiently detecting ECAPsignals. For example, at pulse frequency values (e.g., greater than 1kHz) that cause IMD 110 to deliver another pulse before an ECAP from theprevious pulse can be detected, IMD 110 may not be capable to detectingthe ECAP.

FIG. 9 is a flow diagram of an example technique for selectingstimulation parameter values. FIG. 9 will be described with processingcircuitry 208 of IMD 200, but other devices such as IMD 110 or externalprogrammer 300 may perform similar functions. Besides IMD 200, anexternal programmer, e.g., external programmer 104, may be used alone orconjunction with one or more other medical devices, e.g., IMD 110 or IMD200, to determine and set stimulation parameters.

More particularly, FIG. 9 illustrates method 900 in which processingcircuitry 208 selects a first set of parameters for electricalstimulation (902). The values for the parameters of electricalstimulation, growth curves, posture states, and target ECAPcharacteristic (e.g., values of the ECAP indicative of targetstimulation intensity) may be initially set/predicted at the clinic butmay be set/predicted and/or adjusted at home by patient 102. Once theinitial values are set, the example techniques allow for automaticadjustment.

Processing circuitry 208 can be used to control stimulation generator todeliver electrical stimulation (904) according to the first set ofparameters for electrical stimulation. Sensing circuitry 206 can sensean ECAP signal (906), and then processing circuitry 208 can receive theECAP signal. Processing circuitry 208 can then determine and store avalue indicative of the ECAP signal in memory 216. Processing circuitry208 can determine the current posture state of the patient (908) of thepatient. Processing circuitry 208 may determine the current patientposture state at varying intervals including, e.g., periodic timeintervals, at certain predetermined tasks, in response to trigger eventssuch as patient indications of more movement, or continuously. In otherexamples, the posture state may not be necessary if the growth curve, orgain value, does not change with posture state. Processing circuitry 208can also determine the ECAP differential value calculated by subtractingthe sensed ECAP characteristic value and from the target ECAPcharacteristic value (910).

If the ECAP differential value is positive and greater than zero (“YES”branch of block 910), processing circuitry 208 selects the incrementgrowth curve associated with increasing neural recruitment (912).Conversely, if the ECAP differential value is negative and less thanzero (“NO” branch of block 910), processing circuitry 208 selects thedecrement growth curve associated with decreasing neural recruitment(914). From the selected growth curve, processing circuitry 208 canselect the gain value associated with the selected growth curve (916).As discussed herein, the growth curve may be inversely proportional tothe slope of the growth curve. In other examples, processing circuitry208 may obtain the gain values that are directly associated to thepositive or negative ECAP differential value and/or respective posturestates without the need to first select or obtain a growth curve.

Processing circuitry 208 then multiplies the previously determineddifference between the sensed ECAP characteristic value and the targetECAP characteristic value (e.g., the ECAP differential value) by theselected gain value (918) to determine a new electrical stimulationamplitude. Processing circuitry 208 can then update the parameters forelectrical stimulation (920) with the new stimulation amplitude tocontrol delivery of electrical stimulation (904). After deliveringelectrical stimulation (904), sensing circuitry 206 can again sense theECAP signal (906).

FIG. 10 illustrates a graph 1000 that includes pulse current amplitude1002, threshold ECAP amplitude 1004 (e.g., a type of threshold ECAPcharacteristic value), and sensed ECAP voltage amplitude 1006 as afunction of time, in accordance with one or more techniques of thisdisclosure. For convenience, FIG. 10 is described with respect to IMD200 of FIG. 2 . However, the techniques of FIG. 10 may be performed bydifferent components of IMD 200 than as described herein or byadditional or alternative medical devices.

Graph 1000 illustrates a relationship between sensed ECAP voltageamplitude and stimulation pulse current amplitude. For example, pulsecurrent amplitude 1002 is plotted alongside ECAP voltage amplitude 1006as a function of time, showing how processing circuitry 208 can changestimulation current amplitude relative to ECAP voltage amplitude. Insome examples, IMD 200 delivers a plurality of pulses at pulse currentamplitude 1002. Initially, IMD 200 may deliver a first set ofstimulation pulses at current amplitude I. The first set of stimulationpulses may be delivered prior to time T1. In some examples, currentamplitude I is less than 25 milliamps (mA) and can be between about 2 mAand about 18 mA. However, current amplitude I may be any currentamplitude that IMD 200 can deliver to the patient and appropriate foreffective stimulation therapy for the patient.

While delivering the first set pulses, IMD 200 may record ECAP voltageamplitude 1006 from ECAPs elicited from the respective pulses. Duringtransient patient movement, ECAP voltage amplitude 1006 may increase ifpulse current amplitude 1002 is held constant and the distance betweenthe electrodes and target nerve decreases. For example, as illustratedin FIG. 10 , ECAP voltage amplitude 1006 may increase prior to time T1while stimulation current amplitude is held constant. An increasing ECAPvoltage amplitude 1006 may indicate that patient 102 is at risk ofexperiencing transient overstimulation due to the pulses delivered byIMD 200. To prevent patient 102 from experiencing transientoverstimulation, IMD 200 may decrease pulse current amplitude 1002 inresponse to ECAP voltage amplitude 1006 exceeding the threshold ECAPamplitude 1004. For example, if IMD 200 senses an ECAP having an ECAPvoltage amplitude 1006 meeting or exceeding threshold ECAP amplitude1004, as illustrated in FIG. 10 at time T1, IMD 200 may enter adecrement mode where pulse current amplitude 1002 is decreased. Asdiscussed herein, IMD 200 may use a gain value selected for thedecrement mode such that the magnitude of the decrease in stimulationparameter is appropriate for reducing the stimulation intensity of thenext stimulation pulses. In some examples, the threshold ECAP amplitude1004 is greater than 10 microvolts (μV) and less than 100 μV. Forexample, the threshold ECAP amplitude 1004 can be 30 μV. In otherexamples, the threshold ECAP amplitude 1004 is less than or equal to 10μV or greater than or equal to 100 μV. The exact value of threshold ECAPamplitude 1004 may depend on the patient's perception of the deliveredstimulation, as well as the spacing between the sensing/stimulationelectrodes and the neural tissue, whether or not stimulation intensityis increasing or decreasing, or other factors.

The decrement mode with a plurality of decrement rate settings may, insome cases, be stored in memory 216 of IMD 200 as a part of stimulationparameter settings 220. In the example illustrated in FIG. 10 , thedecrement mode is executed by IMD 200 over a second set of pulses whichoccur between time T1 and time T2. In some examples, each decrement inthe current amplitude 1002 may be determined based on the gain value orgrowth curve for decreasing the current amplitude and, in some examples,the currently detected posture state. In some examples, to execute thedecrement mode, IMD 200 decreases the pulse current amplitude 1002 ofeach pulse of the second set of pulses according to a first linearfunction with respect to time. During a period of time in which IMD 200is operating in the decrement mode (e.g., time interval T2-T1), ECAPvoltage amplitude 1006 of ECAPs sensed by IMD 200 may be greater than orequal to threshold ECAP amplitude 1004.

In the example illustrated in FIG. 2 , IMD 200 may sense an ECAP at timeT2, where the ECAP has an ECAP voltage amplitude 1006 that is less thanthreshold ECAP amplitude 1004. The ECAP sensed at time T2 may, in somecases, be the first ECAP sensed by IMD 200 with a below-thresholdamplitude since IMD 200 began the decrement mode at time T1. Based onsensing the ECAP at time T2, IMD 200 may deactivate the decrement modeand activate an increment mode. As discussed herein, IMD 200 may use again value selected for the increment mode such that the magnitude ofthe increase in stimulation parameter is appropriate for increasing thestimulation intensity of the next stimulation pulses. The increment modewith a plurality of increment rate settings may, in some cases, bestored in memory 216 of IMD 200 as a part of stimulation parametersettings 220. IMD 200 may execute the increment mode over a third set ofpulses which occur between time T2 and time T3. In some examples, toexecute the increment mode, IMD 200 increases the pulse currentamplitude 1002 of each pulse of the third set of pulses according to asecond linear function with respect to time, back up to the initialcurrent amplitude I that may be predetermined for therapy. In otherwords, IMD 200 increases each consecutive pulse of the third set ofpulses proportionally to an amount of time elapsed since a previouspulse. Although IMD 200 may increase and decrease the amplitudes bylinear functions in some examples, IMD 200 may employ non-linearfunctions in other examples. For example, the gain value may represent anon-linear function in which the increment or decrement changesexponentially or logarithmically according to the difference between thesensed ECAP characteristic value and the threshold ECAP amplitude 1004.

When pulse current amplitude 1002 returns to current amplitude I (e.g.,the predetermined value for stimulation pulses), IMD 200 may deactivatethe increment mode and deliver stimulation pulses at constant currentamplitudes. By decreasing stimulation in response to ECAP amplitudesexceeding a threshold ECAP characteristic value and subsequentlyincreasing stimulation in response to ECAP amplitudes falling below thethreshold, IMD 200 may prevent patient 102 from experiencing transientoverstimulation or decrease a severity and/or a time duration oftransient overstimulation experienced by patient 102. In some examples,threshold ECAP amplitude 1004 may include an upper threshold and a lowerthreshold, such that IMD 200 enters the decrement mode when the upperthreshold is exceeded, IMD 200 enters the increment mode when the lowerthreshold is exceeded, and IMD 200 maintains stimulation parametervalues when ECAP voltage amplitude 1006 is between the upper thresholdand the lower threshold.

The following examples are described herein. Example 1, a systemcomprising: stimulation circuitry; sensing circuitry; and processingcircuitry configured to: control the stimulation circuitry to deliver afirst electrical stimulation pulse; control the sensing circuitry todetect, after delivery of the first electrical stimulation pulse, anECAP signal; determine a characteristic value of the ECAP signalelicited by the first electrical stimulation pulse; determine an ECAPdifferential value that indicates whether the characteristic value ofthe ECAP signal elicited by the first electrical stimulation pulse isone of greater than a selected ECAP characteristic value or less thanthe selected ECAP characteristic value; determine, based on the ECAPdifferential value, a gain value; determine, based on the gain value, aparameter value that at least partially defines a second electricalstimulation pulse; and control the stimulation circuitry to deliver thesecond electrical stimulation pulse according to the parameter value.

Example 2: the system of example 1, wherein the parameter value is a newparameter value, and wherein the processing circuitry is configured todetermine the new parameter value by adjusting a previous parametervalue to the new parameter value.

Example 3: the system of any of examples 1 and 2, wherein the gain valueis a first gain value, and wherein the processing circuitry isconfigured to: determine the ECAP differential value by determining apositive ECAP differential value for the characteristic value being lessthan the selected ECAP characteristic value; and responsive todetermining the positive ECAP differential value, select the first gainvalue from a plurality of gain values, wherein the first gain value isassociated the positive ECAP differential value, and wherein the firstgain value is less than a second gain value associated with a negativeECAP differential value.

Example 4: the system of any of examples 1 through 3, wherein the gainvalue is a first gain value, and wherein the processing circuitry isconfigured to: determine the ECAP differential value by determining anegative ECAP differential value for the characteristic value beinggreater than the selected ECAP characteristic value; and responsive todetermining the negative ECAP differential value, select the first gainvalue from a plurality of gain values, wherein the first gain value isassociated the negative ECAP differential value, and wherein the firstgain value is greater than a second gain value associated with apositive ECAP differential value.

Example 5: the system of any of examples 1 through 4, wherein theprocessing circuitry is configured to select, based on the ECAPdifferential value, a growth curve from a plurality of growth curves,and wherein the gain value is inversely proportional to a slope of thegrowth curve defined by a relationship of ECAP values to stimulationparameter values for the patient.

Example 6: the system of any of examples 1 through 5, wherein theprocessing circuitry is configured to select, based on the ECAPdifferential value and a posture state of the patient at a time thesensing circuitry detected the ECAP signal, the gain value from aplurality of gain values, wherein each posture state of a plurality ofposture states is associated with two gain values of the plurality ofgain values, each gain value of the two gain values associated with arespective positive ECAP differential value or negative ECAPdifferential value.

Example 7: the system of example 6, further comprising a posture statesensor, wherein the processing circuitry is configured to receive, fromthe posture state sensor, a signal representing the posture state of thepatient.

Example 8: the system of any of examples 1 through 7, wherein theprocessing circuitry is configured to: control the stimulation circuitryto deliver a plurality of electrical stimulation pulses as a sweep ofpulses comprising iteratively increasing amplitude values anditeratively decreasing amplitude values; determine a first growth curveassociated with the increasing amplitude values; and determine a secondgrowth curve associated with the decreasing amplitude values, whereinthe gain value is derived from one of the first growth curve or thesecond growth curve.

Example 9: the system of any of examples 1 through 8, wherein animplantable medical device comprises the stimulation circuitry, thesensing circuitry, and the processing circuitry.

Example 10: a method comprising: controlling, by processing circuitry,stimulation circuitry to deliver a first electrical stimulation pulse;controlling, by the processing circuitry, sensing circuitry to detect,after delivery of the first electrical stimulation pulse, an ECAPsignal; determining, by the processing circuitry, a characteristic valueof the ECAP signal elicited by the first electrical stimulation pulse;determining, by the processing circuitry, an ECAP differential valuethat indicates whether the characteristic value of the ECAP signalelicited by the first electrical stimulation pulse is one of greaterthan a selected ECAP characteristic value or less than the selected ECAPcharacteristic value; determining, by the processing circuitry and basedon the ECAP differential value, a gain value; determining, by theprocessing circuitry and based on the gain value, a parameter value thatat least partially defines a second electrical stimulation pulse; andcontrolling, by the processing circuitry, the stimulation circuitry todeliver the second electrical stimulation pulse according to theparameter value.

Example 11: the method of example 10, wherein the parameter value is anew parameter value, and wherein determining the new parameter valuecomprises adjusting a previous parameter value to the new parametervalue.

Example 12: the method of any of examples 10 and 11, wherein the gainvalue is a first gain value, wherein determining the ECAP differentialvalue comprises determining a positive ECAP differential value for thecharacteristic value being less than the selected ECAP characteristicvalue, and wherein the method further comprises: responsive todetermining the positive ECAP differential value, selecting the firstgain value from a plurality of gain values, wherein the first gain valueis associated the positive ECAP differential value, and wherein thefirst gain value is less than a second gain value associated with anegative ECAP differential value.

Example 13: the method of any of examples 10 through 12, wherein thegain value is a first gain value, wherein determining the ECAPdifferential value comprises determining a negative ECAP differentialvalue for the characteristic value being greater than the selected ECAPcharacteristic value, and wherein the method further comprises:responsive to determining the negative ECAP differential value, selectthe first gain value from a plurality of gain values, wherein the firstgain value is associated the negative ECAP differential value, andwherein the first gain value is greater than a second gain valueassociated with a positive ECAP differential value.

Example 14: the method of any of examples 10 through 13, furthercomprising selecting, based on the ECAP differential value, a growthcurve from a plurality of growth curves, and wherein the gain value isinversely proportional to a slope of the growth curve defined by arelationship of ECAP values to stimulation parameter values for thepatient.

Example 15: the method of any of examples 10 through 14, furthercomprising selecting, based on the ECAP differential value and a posturestate of the patient at a time the sensing circuitry detected the ECAPsignal, the gain value from a plurality of gain values, wherein eachposture state of a plurality of posture states is associated with twogain values of the plurality of gain values, each gain value of the twogain values associated with a respective positive ECAP differentialvalue or negative ECAP differential value.

Example 16: the method of example 15, further comprising receiving, froma posture state sensor, a signal representing the posture state of thepatient.

Example 17: the method of any of examples 10 through 16, furthercomprising: controlling the stimulation circuitry to deliver a pluralityof electrical stimulation pulses as a sweep of pulses comprisingiteratively increasing amplitude values and iteratively decreasingamplitude values; determining a first growth curve associated with theincreasing amplitude values; and determining a second growth curveassociated with the decreasing amplitude values, wherein the gain valueis derived from one of the first growth curve or the second growthcurve.

Example 18: the method of any of examples 10 through 17, wherein animplantable medical device comprises the stimulation circuitry, thesensing circuitry, and the processing circuitry.

Example 19: a computer-readable storage medium comprising instructionsthat, when executed by processing circuitry, cause the processingcircuitry to: control the stimulation circuitry to deliver a firstelectrical stimulation pulse; control the sensing circuitry to detect,after delivery of the first electrical stimulation pulse, an ECAPsignal; determine a characteristic value of the ECAP signal elicited bythe first electrical stimulation pulse; determine an ECAP differentialvalue that indicates whether the characteristic value of the ECAP signalelicited by the first electrical stimulation pulse is one of greaterthan a selected ECAP characteristic value or less than the selected ECAPcharacteristic value; determine, based on the ECAP differential value, again value; determine, based on the gain value, a parameter value thatat least partially defines a second electrical stimulation pulse; andcontrol the stimulation circuitry to deliver the second electricalstimulation pulse according to the parameter value.

Example 20: the computer-readable storage medium of example 19, furthercomprising instructions that cause the processing circuitry to select,based on the ECAP differential value and a posture state of the patientat a time the sensing circuitry detected the ECAP signal, the gain valuefrom a plurality of gain values, wherein each posture state of aplurality of posture states is associated with two gain values of theplurality of gain values, each gain value of the two gain valuesassociated with a respective positive ECAP differential value ornegative ECAP differential value.

The techniques described in this disclosure may be implemented, at leastin part, in hardware, software, firmware or any combination thereof. Forexample, various aspects of the described techniques may be implementedwithin one or more processors or processing circuitry, including one ormore microprocessors, digital signal processors (DSPs), applicationspecific integrated circuits (ASICs), field programmable gate arrays(FPGAs), or any other equivalent integrated or discrete logic circuitry,as well as any combinations of such components. The term “processor” or“processing circuitry” may generally refer to any of the foregoing logiccircuitry, alone or in combination with other logic circuitry, or anyother equivalent circuitry. A control unit including hardware may alsoperform one or more of the techniques of this disclosure.

Such hardware, software, and firmware may be implemented within the samedevice or within separate devices to support the various operations andfunctions described in this disclosure. In addition, any of thedescribed units, circuits or components may be implemented together orseparately as discrete but interoperable logic devices. Depiction ofdifferent features as circuits or units is intended to highlightdifferent functional aspects and does not necessarily imply that suchcircuits or units must be realized by separate hardware or softwarecomponents. Rather, functionality associated with one or more circuitsor units may be performed by separate hardware or software components orintegrated within common or separate hardware or software components.

The techniques described in this disclosure may also be embodied orencoded in a computer-readable medium, such as a computer-readablestorage medium, containing instructions that may be described asnon-transitory media. Instructions embedded or encoded in acomputer-readable storage medium may cause a programmable processor, orother processor, to perform the method, e.g., when the instructions areexecuted. Computer readable storage media may include random accessmemory (RAM), read only memory (ROM), programmable read only memory(PROM), erasable programmable read only memory (EPROM), electronicallyerasable programmable read only memory (EEPROM), flash memory, a harddisk, a CD-ROM, a floppy disk, a cassette, magnetic media, opticalmedia, or other computer readable media.

What is claimed is:
 1. A system comprising: stimulation circuitry;sensing circuitry; and processing circuitry configured to: control thestimulation circuitry to deliver a first plurality of electricalstimulation pulses as a first sweep of pulses comprising iterativelyincreasing amplitude values; control the stimulation circuitry todeliver a second plurality of electrical stimulation pulses as a secondsweep of pulses comprising iteratively decreasing amplitude values;determine a first growth curve associated with the increasing amplitudevalues of the first sweep; determine a second growth curve associatedwith the decreasing amplitude values of the second sweep; determine afirst gain value associated with the first growth curve; determine asecond gain value associated with the second growth curve; control thestimulation circuitry to deliver a subsequent electrical stimulationpulse; control the sensing circuitry to detect, after delivery of thesubsequent electrical stimulation pulse, an ECAP signal; determine acharacteristic value of the ECAP signal elicited by the subsequentelectrical stimulation pulse; determine an ECAP differential value thatindicates whether the characteristic value of the ECAP signal elicitedby the first electrical stimulation pulse is one of greater than aselected ECAP characteristic value or less than the selected ECAPcharacteristic value; select, based on the ECAP differential value, oneof the first gain value or the second gain value; determine, based onthe one of the first gain value or the second gain value, a parametervalue that at least partially defines a second electrical stimulationpulse; and control the stimulation circuitry to deliver the secondelectrical stimulation pulse according to the parameter value.
 2. Thesystem of claim 1, wherein the parameter value is a new parameter value,and wherein the processing circuitry is configured to determine the newparameter value by adjusting a previous parameter value to the newparameter value.
 3. The system of claim 1, wherein the gain value is afirst gain value, and wherein the processing circuitry is configured to:determine the ECAP differential value by determining a positive ECAPdifferential value for the characteristic value being less than theselected ECAP characteristic value; and responsive to determining thepositive ECAP differential value, select the first gain value, whereinthe first gain value is associated the positive ECAP differential value,and wherein the first gain value is less than a second gain valueassociated with a negative ECAP differential value.
 4. The system ofclaim 1, wherein the gain value is a first gain value, and wherein theprocessing circuitry is configured to: determine the ECAP differentialvalue by determining a negative ECAP differential value for thecharacteristic value being greater than the selected ECAP characteristicvalue; and responsive to determining the negative ECAP differentialvalue, select the first gain value, wherein the first gain value isassociated the negative ECAP differential value, and wherein the firstgain value is greater than a second gain value associated with apositive ECAP differential value.
 5. The system of claim 1, wherein atleast one of the first gain value or the second gain value is inverselyproportional to a slope of the respective first or second growth curvedefined by a relationship of ECAP values to stimulation parameter valuesfor the patient.
 6. The system of claim 1, wherein the processingcircuitry is configured to select, based on the ECAP differential valueand a posture state of the patient at a time the sensing circuitrydetected the ECAP signal, one of the first gain value or the second gainvalue, wherein each posture state of a plurality of posture states isassociated with two gain values of the plurality of gain values, eachgain value of the two gain values associated with a respective positiveECAP differential value or negative ECAP differential value.
 7. Thesystem of claim 6, further comprising a posture state sensor, whereinthe processing circuitry is configured to receive, from the posturestate sensor, a signal representing the posture state of the patient. 8.The system of claim 1, wherein an implantable medical device comprisesthe stimulation circuitry, the sensing circuitry, and the processingcircuitry.
 9. A method comprising: controlling, by processing circuitry,the stimulation circuitry to deliver a first plurality of electricalstimulation pulses as a first sweep of pulses comprising iterativelyincreasing amplitude values; controlling, by the processing circuitry,the stimulation circuitry to deliver a second plurality of electricalstimulation pulses as a second sweep of pulses comprising iterativelydecreasing amplitude values; determining, by the processing circuitry, afirst growth curve associated with the increasing amplitude values ofthe first sweep; determining, by the processing circuitry, a secondgrowth curve associated with the decreasing amplitude values of thesecond sweep; determining, by the processing circuitry, a first gainvalue associated with the first growth curve; determining, by theprocessing circuitry, a second gain value associated with the secondgrowth curve; controlling, by the processing circuitry, stimulationcircuitry to deliver a subsequent electrical stimulation pulse;controlling, by the processing circuitry, sensing circuitry to detect,after delivery of the subsequent electrical stimulation pulse, an ECAPsignal; determining, by the processing circuitry, a characteristic valueof the ECAP signal elicited by the subsequent electrical stimulationpulse; determining, by the processing circuitry, an ECAP differentialvalue that indicates whether the characteristic value of the ECAP signalelicited by the first electrical stimulation pulse is one of greaterthan a selected ECAP characteristic value or less than the selected ECAPcharacteristic value; selecting, by the processing circuitry and basedon the ECAP differential value, one of the first gain value or thesecond gain value; determining, by the processing circuitry and based onthe one of the first gain value or the second gain value, a parametervalue that at least partially defines a second electrical stimulationpulse; and controlling, by the processing circuitry, the stimulationcircuitry to deliver the second electrical stimulation pulse accordingto the parameter value.
 10. The method of claim 9, wherein the parametervalue is a new parameter value, and wherein determining the newparameter value comprises adjusting a previous parameter value to thenew parameter value.
 11. The method of claim 9, wherein the gain valueis a first gain value, wherein determining the ECAP differential valuecomprises determining a positive ECAP differential value for thecharacteristic value being less than the selected ECAP characteristicvalue, and wherein the method further comprises: responsive todetermining the positive ECAP differential value, selecting the firstgain value, wherein the first gain value is associated the positive ECAPdifferential value, and wherein the first gain value is less than asecond gain value associated with a negative ECAP differential value.12. The method of claim 9, wherein the gain value is a first gain value,wherein determining the ECAP differential value comprises determining anegative ECAP differential value for the characteristic value beinggreater than the selected ECAP characteristic value, and wherein themethod further comprises: responsive to determining the negative ECAPdifferential value, select the first gain value, wherein the first gainvalue is associated the negative ECAP differential value, and whereinthe first gain value is greater than a second gain value associated witha positive ECAP differential value.
 13. The method of claim 9, whereinat least one of the first gain value or the second gain value isinversely proportional to a slope of the respective first or secondgrowth curve defined by a relationship of ECAP values to stimulationparameter values for the patient.
 14. The method of claim 9, furthercomprising selecting, based on the ECAP differential value and a posturestate of the patient at a time the sensing circuitry detected the ECAPsignal, one of the first gain value or the second gain value from aplurality of gain values, wherein each posture state of a plurality ofposture states is associated with two gain values of the plurality ofgain values, each gain value of the two gain values associated with arespective positive ECAP differential value or negative ECAPdifferential value.
 15. The method of claim 14, further comprisingreceiving, from a posture state sensor, a signal representing theposture state of the patient.
 16. The method of claim 9, wherein animplantable medical device comprises the stimulation circuitry, thesensing circuitry, and the processing circuitry.
 17. A computer-readablestorage medium comprising instructions that, when executed by processingcircuitry, cause the processing circuitry to: control the stimulationcircuitry to deliver a first plurality of electrical stimulation pulsesas a first sweep of pulses comprising iteratively increasing amplitudevalues; control the stimulation circuitry to deliver a second pluralityof electrical stimulation pulses as a second sweep of pulses comprisingiteratively decreasing amplitude values; determine a first growth curveassociated with the increasing amplitude values of the first sweep;determine a second growth curve associated with the decreasing amplitudevalues of the second sweep; determine a first gain value associated withthe first growth curve; determine a second gain value associated withthe second growth curve; control the stimulation circuitry to deliver asubsequent electrical stimulation pulse; control the sensing circuitryto detect, after delivery of the subsequent electrical stimulationpulse, an ECAP signal; determine a characteristic value of the ECAPsignal elicited by the subsequent electrical stimulation pulse;determine an ECAP differential value that indicates whether thecharacteristic value of the ECAP signal elicited by the first electricalstimulation pulse is one of greater than a selected ECAP characteristicvalue or less than the selected ECAP characteristic value; select, basedon the ECAP differential value, one of the first gain value or thesecond gain value; determine, based on the one of the first gain valueor the second gain value, a parameter value that at least partiallydefines a second electrical stimulation pulse; and control thestimulation circuitry to deliver the second electrical stimulation pulseaccording to the parameter value.
 18. The computer-readable storagemedium of claim 17, further comprising instructions that cause theprocessing circuitry to select, based on the ECAP differential value anda posture state of the patient at a time the sensing circuitry detectedthe ECAP signal, one of the first gain value or the second gain value,wherein each posture state of a plurality of posture states isassociated with two gain values of the plurality of gain values, eachgain value of the two gain values associated with a respective positiveECAP differential value or negative ECAP differential value.